Deleted .config - how to recreate


I accidentally deleted my '' bin '' folder and also my .config. My router has been flashed with my latest .config and everything is ok but I would like to know if from my image on the router and / or with my working folder / openwrt / folder, if it is possible to recreate my .config?

thank you

Do you have a .config.old?

For the future:

unfortunately not

Yes, if have selected the option to store it inside the image itself...


    bool "Include build configuration in firmware"
1 Like

Great , i did not know about that option.
It should be stored in etc/config after that?


/etc/config is only for uci config files for router itself.

It would be a file called /etc/build.config

(and it contains only the deviations from defaults, not the full .config, which would be much larger. You can expand that to .config by first copying it to be .config and then run make defconfig )

1 Like

I can't find it, maye cause I use experimental kernel option, 5.10 ?

You need to enable Developer options first:

"Advanced configuration options (for developers)";a=blob;f=config/;h=342859b7c0cdba020e73fb2eadea0e40d74204d0;hb=HEAD#l112

 112         config INCLUDE_CONFIG
 113                 bool "Include build configuration in firmware" if DEVEL
 114                 default n
 115                 help
 116                   If enabled, buildinfo files will be stored in /etc/build.* of firmware.

A bit cryptic that it requires extra options from another menu to be visible.

1 Like