I have several .config files, each for different targets. Is there any way to just say make myconf.config instead of have to load it, save it as .config then make?
I have RTFM and I just want to clarify my understanding:
Creating diff file
This file is created using the ./scripts/diffconfig.sh script.
./scripts/diffconfig.sh > diffconfig # write the changes to diffconfig
Note: Since r2752 LEDE firmware make process automatically creates the configuration diff file config.seed file to the target image directory.
Using diff file
These changes can form the basis of a config file ( <buildroot dir>/.config ). By running make defconfig these changes will be expanded into a full config.
cp diffconfig .config # write changes to .config make defconfig # expand to full config
These changes can also be added to the bottom of the config file ( <buildroot dir>/.config ), by running make defconfig these changes will override the existing configuration.
cat diffconfig >> .config # append changes to bottom of .config make defconfig # apply changes
Does this mean we can have several diffconfig files, such as target1_diffconfigtarget2_diffconfig, and to use them we just need to say
cp target1_diffconfig .config # write changes to .config
make defconfig # expand to full config
make
I split my config into a target specific part and a generic part, concatenating it as needed when I build an image, e.g.:
$ cat /path/from/{ath79-tiny.init,config.init} >.config
$ make defconfig oldconfig
ath79-tiny.init:
##### ath79.init: start #####
### Use "make defconfig oldconfig" to expand this to a full .config
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_tplink_tl-wr941-v2=y
CONFIG_TARGET_DEVICE_PACKAGES_ath79_tiny_DEVICE_tplink_tl-wr941-v2="-opkg -ppp-mod-pppoe -ppp -kmod-pppoe -kmod-pppox -kmod-ppp -kmod-ipt-offload -kmod-nf-flow -swconfig -wpad-basic wpad-mini -wpad -wpad-openssl"
### Debugging options
# CONFIG_KERNEL_KALLSYMS is not set
### Minify lua
CONFIG_LUCI_SRCDIET=y
### don't build deprecated ciphers for openssl
# CONFIG_OPENSSL_WITH_DEPRECATED is not set
##### ath79.init: stop #####
Doing it this way takes a little more effort beforehand, minifying the diffconfig.sh even further, but is very flexible across multiple targets afterwards. Obviously using =m (instead of =y) as much as possible in config.init and including it dynamically into the different devices I'm building for a given target (taking ath79-tiny as the most simple example, ath79, bcm47xx, ipq40xx, ipq806x or lantiq are a lot more complex, building for multiple devices with different feature sets each).