Storing build configuration for later builds

Hi all,

I have successfully compiled OpenWRT 19.07 for my Banana PI R2. Now the question is what is the best process to make sure when a new stable version of OpenWRT arrives, that I can build the new version with all the settings I already applied to the previous build? For my use cases to work it was necessary to change various options in "menuconfig" and some in "kernel_menuconfig".

How are you guys dealing with such a scenario? Is there a best practice approach to go? Can I store the config files and apply them later on?



Just save .config in the root of the build tree to a different file name and then you can re-use it. Within reason of course - if you wait 5 years to do an upgrade then this isn't going to work.

If you changed the kernel config with kernel_menuconfig, it depends on how you invoked it where the changes will be stored. A good way to invoke for custom changes is make kernel_menuconfig CONFIG_TARGET=env. Then you will get a file env/kernel-config that contains your kernel config deltas.

You should be able to work out which config file has been changed if you go a git status as it will show you the modified files.

Thanks for your quick answer!

The only modified file "git status" is showing is this one:


which is strange because the kernel options are not included there. What I needed to activate in kernel config was the support for "Root system on NFS". This option is also there in the "normal" config (menuconfig), where I also activated it. Is it possible that activating it in "menuconfig" is sufficient and that is why kernel config does not change?

Does it mean that saving that file (or committing it in my local repository) is sufficient to be able to build future versions?



configdiff may prove to be less error prone over time as commits change things.

1 Like

If the option is there in the normal menuconfig then you don't need to change the kernel config. Although clearly you have changed something since the config-5.14 file is showing it's modified. A git diff will show you the changes.

Yes, the config-4.14 file contains the changes I did with "menuconfig". So I will make sure to keep this file secured and restore the options before my next build.

Is this the list of commands to be executed when I switch to a new tag/branch?

./scripts/feeds update -a
make defconfig