hi everyone,

with the current kamikaze build system, platform support provide a config/default with kernel config options for most of the boards built with the target platform.
When making a kernel_menuconfig, all changes are saved in the config/default config file. But in fact they could be saved to a config/profile-$(PROFILE), because with kernel_menuconfig we are already customizing the firmware. It would be good to keep the default as a base if one make several configs for different boards within one target.
A try :

=== include/kernel-build.mk
==================================================================
--- include/kernel-build.mk     (revision 2475)
+++ include/kernel-build.mk     (local)
@@ -161,12 +161,22 @@
 download: $(DL_DIR)/$(LINUX_SOURCE)
 prepare: $(LINUX_DIR)/.configured
 compile: $(LINUX_DIR)/.modules
-menuconfig: $(LINUX_DIR)/.prepared FORCE
+default_menuconfig: $(LINUX_DIR)/.prepared FORCE
        $(call Kernel/Configure)
-       $(SCRIPT_DIR)/config.pl '+' $(GENERIC_PLATFORM_DIR)/config-template $(LINUX_CONFIG) > $(LINUX_DIR)/.config  << btw, it seems this line is redundant with Kernel/Configure(/Default) code, no ?
        $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) menuconfig
        $(SCRIPT_DIR)/config.pl '>' $(GENERIC_PLATFORM_DIR)/config-template $(LINUX_DIR)/.config > $(LINUX_CONFIG)
 
+menuconfig: $(LINUX_DIR)/.prepared FORCE
+       @if [ ! -f "$(LINUX_CONFIG)" ]; then \
+               echo "Default config not yet created for this target"; \
+               echo "Please run make default_kernel_menuconfig"; \
+               false; \
+       fi
+       $(call Kernel/Configure)
+       $(SCRIPT_DIR)/config.pl '+' $(GENERIC_PLATFORM_DIR)/config-template $(LINUX_CONFIG) > $(LINUX_DIR)/generic_and_default.config
+       $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) menuconfig
+       $(SCRIPT_DIR)/config.pl '>'  $(LINUX_DIR)/generic_and_default.config $(LINUX_DIR)/.config > ./config/profile-$(PROFILE)
+
 install: $(LINUX_DIR)/.image
 
 clean: FORCE

maybe generic_and_default.config should be written in a tmp directory...

So, to edit the config/default there should be a different make target, like 'make default_kernel_menuconfig'...

Or else, 'make kernel_menuconfig' could edit the config/default, and a 'make $(PROFILE)_kernel_menuconfig' could do it for the profile.
I think the former is easier to use, as the config/default is supposed to be somewhat fixed when a platform is said supported.

So to customize OpenWrt, steps are :
- create a profile makefile to define what drivers or kmods will be used for your specific board.
- make kernel_menuconfig for this profile to keep only essential things.
- make menuconfig for base lan conf and utilities and packages used.
- make.

What do you think ?