Skip to contentSkip to conversation

savedefconfig: Remove BR2_DEFCONFIG from saved defconfig file

PATCH New Herve Codina 3 participants 3 messages Jun 4, 2015 – Jun 6, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 savedefconfig: Remove BR2_DEFCONFIG from saved defconfig file

BR2_DEFCONFIG should not be present in saved defconfig file.

The use case is:
make qemu_arm_versatile
make savedefconfig BR2_DEFCONFIG=my_custom_defconfig

BR2_DEFCONFIG is set in my_custom_defconfig with an absolute path to qemu_arm_versatile (value present in .config) and set in my_custom_defconfig as it is different from default mentionned in config.in (default is BR2_DEFCONFIG from environnement).

On savedefconfig recipe, simply remove BR2_DEFCONFIG from generated file

---
 Makefile |    1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 43b5ba5..3c9e6fb 100644
@@ -777,6 +777,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@$(COMMON_CONFIG_ENV) $< \
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 		$(CONFIG_CONFIG_IN)
+	@sed -i '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
 
 .PHONY: defconfig savedefconfig
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 savedefconfig: Remove BR2_DEFCONFIG from saved defconfig file

Quoted 8 lines · Herve Codina

BR2_DEFCONFIG should not be present in saved defconfig file.

The use case is:
make qemu_arm_versatile
make savedefconfig BR2_DEFCONFIG=my_custom_defconfig

BR2_DEFCONFIG is set in my_custom_defconfig with an absolute path to qemu_arm_versatile (value present in .config) and set in

Although that behaviour is clearly wrong, I thought long and hard about what
the appropriate behaviour would be. And indeed, even if you _don't_ change the value of BR2_DEFCONFIG, it should not be saved into the defconfig file itself.

I also thought Yann had a similar patch pending but couldn't find anything.

So yes, this gets my

except for some small nits below.

Quoted 1 line

my_custom_defconfig as it is different from default mentionned in

mentioned

Quoted 1 line

config.in (default is BR2_DEFCONFIG from environnement).

environment

Quoted 13 lines

On savedefconfig recipe, simply remove BR2_DEFCONFIG from generated file

---
 Makefile |    1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index 43b5ba5..3c9e6fb 100644

Makefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile · line 780

Quoted 4 lines
Makefile +1 -0
@@ -777,6 +777,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@$(COMMON_CONFIG_ENV) $< \
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 		$(CONFIG_CONFIG_IN)
+	@sed -i '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)

sed -i -> $(SED)

Now I see this, I wonder whether the condition is really needed. savedefconfig
only makes sense if there already is a .config, and if there is a .config, it will have BR2_DEFCONFIG defined. But that's for a separate patch.

Regards,
Arnout

Quoted 4 lines
Makefile +0 -0
 .PHONY: defconfig savedefconfig
 
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
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
#2 lore raw

PATCH 1/1 savedefconfig: Remove BR2_DEFCONFIG from saved defconfig file

In reply to Herve Codina
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Herve" == Herve Codina <[email protected]> writes:

BR2_DEFCONFIG should not be present in saved defconfig file. The use case is:
make qemu_arm_versatile
make savedefconfig BR2_DEFCONFIG=my_custom_defconfig

Quoted 8 lines

BR2_DEFCONFIG is set in my_custom_defconfig with an absolute path to qemu_arm_versatile (value present in .config) and set in my_custom_defconfig as it is different from default mentionned in config.in (default is BR2_DEFCONFIG from environnement).

On savedefconfig recipe, simply remove BR2_DEFCONFIG from generated file

Committed with the issues pointed out by Arnout fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard