Obtain kernel config from currently running OpenWrt system

Hi there,

I build my own openwrt config a while ago. Now I lost the config file I used with menuconfig.
Can I obtain that file somehow from my running openwrt system? I wanted to upgrade to a newer version but maintain the package combination I have.

Best wishes,
Alex.

If you use Attended Sysupgrade it will build a custom image for you with all the existing packages included.

1 Like

Copy the output of

opkg list-installed | awk '{ printf "%s ",$1 }'

To the online image builder and you’re done.

1 Like

if you compiled the option "Kernel .config support" into a custom kernel configuration when you built it, then you can zcat /proc/config.gz to get the kernel config

If you compiled the option CONFIG_INCLUDE_CONFIG ("Include build configuration in firmware") then the config will be located in /etc/build.config.

1 Like

thank you, unfortunately it seems that none of the two complie options were set, because I am missing these files. But good to know, thank you

what is the "online image builder" ? How can I use that one with menuconfig

Great and I will defenitely go for it, but for now I need to setup another identical device and therefor I need to build the image again. I want to build a mesh and I bought another device on ebay. Now I need to flash it like the other one, but I am missing the custom kernel config for menuconfig.
Can I extract that information from attended sysupgrade somehow?

Attended sysupgrade only lets you customise packages. I doesn't change kernel config as far as I'm aware.

Guess you need to decide if the custom kernel changes are absolutely necessary. I've found updating openwrt so much smoother using attended sysupgrade!

This: https://firmware-selector.openwrt.org/

Just copy-paste the output of the command I wrote in the box:

you can't use it with menuconfig, but if you don't need other options inside the kernel you can save some time.

But if you will make your build, remember what @dl12345 said here: Obtain kernel config from currently running OpenWrt system - #4 by dl12345 to enable to export/view the kernel config for your next update/image.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.