Creating a config from .config backup or config.buildinfo

i had a hdd failure and lost all my vm with my build system and im wanting to set it up all again but im wondering on the procedure to create a config for the new build system from the backup.

what i have is a .config and a config.buildinfo from the original build system.

From what I gather just dropping my .config into a new build system can cause issues if things have changed, what is the correct procedure to save me from having to reselect everything again in menuconfig ?

I believe I need to create a seed file is this what the config.build info is?
Can just run make defconfig with this file in the root directory and it will create a new .config is this correct ? and will it select my target and all modules as per my original build system.

What does ./scripts/diffconfig.shdo im guessing it creates a config.build for a .config file ?

IME...

diffconfig.sh gives you the minimal set of differences between default and what you have configured (ie, currently in .config). I store them in names like WN604-20210706-working-no-luci.diffconfig.

You can then copy that to .config and use make defconfig to get a fully populated config file - so taking you back to where you started if still using the same OpenWRT version. I've never had it fail to apply to a later version, but presumably that could happen, especially with the switch from ar71xx to ath79. The good news here is that you can use diffconfig to get a sense of whether your prior and latest changes look equivalent.

I'll stop there as we're largely repeating the advice here: https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#configure_using_config_diff_file

IanC

2 Likes

ok co i copied my original config into the base folder then run the commands as follows :

./scripts/diffconfig.sh > diffconfig
cp diffconfig .config

But I recieve the following error when running make defconfig after creating a config seed :

can't find file Config.in
make: *** [/home/professor_jonny/pj_openwrt/include/toplevel.mk:120: defconfig] Error 1

i think the error has to do with files in /tmp/ as if i delete these files i can delete the config and run make menuconfig

possibly useful bits, I would start with the seed file config.buildinfo

1 Like

So I started from A complete new git clone from main repo and update the feeds.
I then renamed config.buildinfo from my backup to .config commands as below:

git clone https://github.com/professor-jonny/pj_openwrt.git
./scripts/feeds update -a
./scripts/feeds install -a
cp config.buildinfo .config
Make defconfig

I still get this error:
I'm running ubuntu 20.04 LTS under WSL2 in Windows 10.

I'm stumped I definatly can't create a new config from a seed file it has to be some sort of error under WSL or ubuntu 20.04.

professor_jonny@MRSPARKLE:~/pj_openwrt$ make defconfig
Collecting package info: done
Collecting target info: done
can't find file Config.in
make: *** [/home/professor_jonny/pj_openwrt/include/toplevel.mk:120: defconfig] Error 1

I get the same Config.in file error what is the config.in
below is the content of the toplevel.mk

defconfig: scripts/config/conf prepare-tmpinfo FORCE
	touch .config
	@if [ ! -s .config -a -e $(HOME)/.openwrt/defconfig ]; then cp $(HOME)/.openwrt/defconfig .config; fi
	[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
		$< $(KCONF_FLAGS) --defconfig=.config Config.in

confdefault-y=allyes
confdefault-m=allmod
confdefault-n=allno
confdefault:=$(confdefault-$(CONFDEFAULT))

Ok i found my issue because I'm on windows and have extentions hidden when i delete the config file in the root of the repo it actually was a config.in file silly me.

it is all working now man i feel stupid.

1 Like

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