barebox: Allow to pass a custom configuration file
PATCH 1/1 barebox: Allow to pass a custom configuration file
--- boot/barebox/Config.in | 21 +++++++++++++++++++++ boot/barebox/barebox.mk | 16 +++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-)
boot/barebox/Config.in +21 -0
@@ -75,12 +75,33 @@ config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION endif + +choice + prompt "Barebox configuration" + default BR2_TARGET_BAREBOX_USE_DEFCONFIG + +config BR2_TARGET_BAREBOX_USE_DEFCONFIG + bool "Using a defconfig" + +config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG + bool "Using a custom config file" + +endchoice + config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG string "board defconfig" + depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG help Name of the board for which Barebox should be built, without the _defconfig suffix. + +config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE + string "Configuration file path" + depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG + help + Path to the kernel configuration file + config BR2_TARGET_BAREBOX_BAREBOXENV bool "bareboxenv tool in target" help
boot/barebox/barebox.mk +11 -5
@@ -37,8 +37,6 @@ ifneq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y) BAREBOX_INSTALL_TARGET = NO endif -BAREBOX_BOARD_DEFCONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG)) - ifeq ($(KERNEL_ARCH),i386) BAREBOX_ARCH=x86 else ifeq ($(KERNEL_ARCH),powerpc)
@@ -49,8 +47,16 @@ endif BAREBOX_MAKE_FLAGS = ARCH=$(BAREBOX_ARCH) CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" + +ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y) +BAREBOX_SOURCE_CONFIG = $(@D)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig +else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y) +BAREBOX_SOURCE_CONFIG = $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) +endif + define BAREBOX_CONFIGURE_CMDS - $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) $(BAREBOX_BOARD_DEFCONFIG)_defconfig + cp $(BAREBOX_SOURCE_CONFIG) $(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_defconfig + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_defconfig endef ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
@@ -80,8 +86,8 @@ $(eval $(generic-package)) ifeq ($(BR2_TARGET_BAREBOX),y) # we NEED a board defconfig file unless we're at make source ifeq ($(filter source,$(MAKECMDGOALS)),) -ifeq ($(BAREBOX_BOARD_DEFCONFIG),) -$(error No Barebox defconfig file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG setting) +ifeq ($(BAREBOX_SOURCE_CONFIG),) +$(error No Barebox config file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG setting) endif endif
Signature · 1 line
1.7.9.5
PATCH 1/1 barebox: Allow to pass a custom configuration file
Quoted 1 line · Maxime Ripard
Signed-off-by Maxime Ripard<[email protected]>
[snip]
boot/barebox/Config.in config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION · line 103
Quoted 5 lines
boot/barebox/Config.in +5
-0+config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE + string "Configuration file path" + depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG + help + Path to the kernel configuration file
^^^^^^
barebox[snip]
Quoted 2 lines
+ifeq ($(BAREBOX_SOURCE_CONFIG),)
+$(error No Barebox config file. Check yourBR2_TARGET_BAREBOX_BOARD_DEFCONFIGsetting)
or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE
Regards,
Arnout
Quoted 3 lines
endif
endif
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 barebox: Allow to pass a custom configuration file
Le 18/10/2012 21:56, Arnout Vandecappelle a ?crit :
Quoted 11 lines · Maxime Ripard
Quoted 1 line
Signed-off-by Maxime Ripard<[email protected]>[snip]
boot/barebox/Config.in config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION · line 103
Quoted 5 lines
boot/barebox/Config.in +5
-0+config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE + string "Configuration file path" + depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG + help + Path to the kernel configuration file^^^^^^ barebox
Quoted 6 lines
[snip]
Quoted 3 lines
+ifeq ($(BAREBOX_SOURCE_CONFIG),)
+$(error No Barebox config file. Check yourBR2_TARGET_BAREBOX_BOARD_DEFCONFIGsetting)or
BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE
Ah, yes, thanks
Maxime
Signature · 4 lines
Maxime Ripard, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/1 barebox: Allow to pass a custom configuration file
In reply to Maxime Ripardboot/barebox/barebox.mk endif · line 60
Quoted 5 lines · Maxime Ripard
define
BAREBOX_CONFIGURE_CMDSboot/barebox/barebox.mk +2
-1- $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) $(BAREBOX_BOARD_DEFCONFIG)_defconfig + cp $(BAREBOX_SOURCE_CONFIG) $(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_defconfig + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_defconfig endef
Could you also add barebox-update-{def,}config targets that save the config
back to BAREBOX_SOURCE_CONFIG ?
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F