Skip to contentSkip to conversation

config: make it possible to specify which config file to use for 'make defconfig'

PATCH Superseded Arnout Vandecappelle (Essensium/Mind) 2 participants 2 messages Mar 11, 2012 – Mar 12, 2012 Kbuild

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 config: make it possible to specify which config file to use for 'make defconfig'

So that this works:

% make defconfig BR2_DEFCONFIG=~/buildroot-defconfig

Right now we have to do:

% cp ~/buildroot-defconfig configs/buildroot_defconfig % make buildroot_defconfig

That would dirty the buildroot tree and requires it to be writable.

---
v2:
* Use $(if...) instead of $(patsubst...)
* Add help text
* Fix commit message

 Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Makefile +2 -1
index d508888..4637d7e 100644
@@ -602,7 +602,7 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --defconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN)
 
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
@@ -663,6 +663,7 @@ help:
 	@echo '  oldconfig              - resolve any unresolved symbols in .config'
 	@echo '  randconfig             - New config with random answer to all options'
 	@echo '  defconfig              - New config with default answer to all options'
+	@echo '                             BR2_DEFCONFIG, if set, is used as input'
 	@echo '  savedefconfig          - Save current config as ./defconfig (minimal config)'
 	@echo '  allyesconfig           - New config where all options are accepted with yes'
 	@echo '  allnoconfig            - New config where all options are answered with no'
Signature · 1 line
tg: (dca6e03..) t/defconfig (depends on: master)
#1 lore raw

PATCH v2 1/1 config: make it possible to specify which config file to use for 'make defconfig'

Le Sun, 11 Mar 2012 12:14:42 +0100,
"Arnout Vandecappelle (Essensium/Mind)" <[email protected]> a ?crit :

Quoted 6 lines

So that this works:

% make defconfig BR2_DEFCONFIG=~/buildroot-defconfig

Right now we have to do:

Quoted 8 lines

% cp ~/buildroot-defconfig configs/buildroot_defconfig % make buildroot_defconfig

That would dirty the buildroot tree and requires it to be writable.

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com