Skip to contentSkip to conversation

Linux and busybox-configfiles

Buildroot New Stephan Hoffmann 5 participants 17 messages Jan 27, 2013 – Feb 14, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

I have prepared two patches that save these config files in $(TOPDIR), where buildroot's own config file lives. After "make clean", these files are used instead of those named in the buildroot config.

Calling "make xxx-defconfig" removes the saved config files, so that again the configuration from buildroot's config file is used.

The same issue appears with uClibc, ct-ng and probably others, but I do not think that many users modify these settings.

If these patches get accepted I will update the documentation, too.

Kind regards

Stephan

Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
#1 lore raw

PATCH 1/2 Busybox: save a copy of the config file

"make busybox-xconfig" stores the changes made in the build directory. Calling "make clean && make" later discards and replaces them with the default values. This is not what a user expects.

This patch saves a copy of the modified config file as $(TOPDIR)/busybox-config and retrieves it from there after "make clean". $(TOPDIR)/busybox-config is removed when a new defconfig is made.

---
 Makefile                   |    2 ++
 package/busybox/busybox.mk |   20 ++++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
Makefile +2 -0
index 6f8ed0e..95ed683 100644
@@ -673,10 +673,12 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
+	rm -f $(TOPDIR)/busybox-config
 	@$(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
+	rm -f $(TOPDIR)/busybox-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
package/busybox/busybox.mk +18 -2
index 9154c08..b81a4f5 100644
@@ -33,6 +33,9 @@ BUSYBOX_CFLAGS_busybox += -ltirpc
 endif
 
 BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
+# Place to save configuration when "make clean" is issued
+BUSYBOX_CONFIG_SAVE = $(TOPDIR)/busybox-config
+
 # Allows the build system to tweak CFLAGS
 BUSYBOX_MAKE_ENV = \
 	$(TARGET_MAKE_ENV) \
@@ -47,8 +50,9 @@ BUSYBOX_MAKE_OPTS = \
 	CONFIG_PREFIX="$(TARGET_DIR)" \
 	SKIP_STRIP=y
 
+# Name the local variable different from environment to be able to distinguish later
 ifndef BUSYBOX_CONFIG_FILE
-	BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
+	LOCAL_BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
 endif
 
 define BUSYBOX_PERMISSIONS
@@ -126,9 +130,19 @@ define BUSYBOX_NETKITTELNET
 endef
 endif
 
+ifndef BUSYBOX_CONFIG_FILE
+# Keep a local copy of the config file to preserve changes over "make clean"
+define BUSYBOX_COPY_CONFIG
+	test ! -f $(BUSYBOX_CONFIG_SAVE) && \
+		cp -f $(LOCAL_BUSYBOX_CONFIG_FILE) $(BUSYBOX_CONFIG_SAVE); \
+	cp -f $(BUSYBOX_CONFIG_SAVE) $(BUSYBOX_BUILD_CONFIG)
+endef
+else
+# When the environmant variable is present we always want to use this config file
 define BUSYBOX_COPY_CONFIG
 	cp -f $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
 endef
+endif
 
 # Disable shadow passwords support if unsupported by the C library
 ifeq ($(BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS),)
@@ -220,8 +234,10 @@ $(eval $(generic-package))
 busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch
 	$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(BUSYBOX_DIR) \
 		$(subst busybox-,,$@)
+	cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_SAVE)
 	rm -f $(BUSYBOX_DIR)/.stamp_built
 	rm -f $(BUSYBOX_DIR)/.stamp_target_installed
 
 busybox-update-config:
-	cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
+	cp -f $(BUSYBOX_BUILD_CONFIG) $(LOCAL_BUSYBOX_CONFIG_FILE)
+
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 1/2 Busybox: save a copy of the config file

Hi,

since this patch is obsolete I set it to Rejected on patchwork.

Regards

Stephan

Am 27.01.2013 17:11, schrieb Stephan Hoffmann:

Quoted 90 lines

"make busybox-xconfig" stores the changes made in the build directory. Calling "make clean && make" later discards and replaces them with the default values. This is not what a user expects.

This patch saves a copy of the modified config file as $(TOPDIR)/busybox-config and retrieves it from there after "make clean". $(TOPDIR)/busybox-config is removed when a new defconfig is made.

---
 Makefile                   |    2 ++
 package/busybox/busybox.mk |   20 ++++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
Makefile +2 -0
index 6f8ed0e..95ed683 100644
@@ -673,10 +673,12 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
+	rm -f $(TOPDIR)/busybox-config
 	@$(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
+	rm -f $(TOPDIR)/busybox-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
package/busybox/busybox.mk +18 -2
index 9154c08..b81a4f5 100644
@@ -33,6 +33,9 @@ BUSYBOX_CFLAGS_busybox += -ltirpc
 endif
 
 BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
+# Place to save configuration when "make clean" is issued
+BUSYBOX_CONFIG_SAVE = $(TOPDIR)/busybox-config
+
 # Allows the build system to tweak CFLAGS
 BUSYBOX_MAKE_ENV = \
 	$(TARGET_MAKE_ENV) \
@@ -47,8 +50,9 @@ BUSYBOX_MAKE_OPTS = \
 	CONFIG_PREFIX="$(TARGET_DIR)" \
 	SKIP_STRIP=y
 
+# Name the local variable different from environment to be able to distinguish later
 ifndef BUSYBOX_CONFIG_FILE
-	BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
+	LOCAL_BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
 endif
 
 define BUSYBOX_PERMISSIONS
@@ -126,9 +130,19 @@ define BUSYBOX_NETKITTELNET
 endef
 endif
 
+ifndef BUSYBOX_CONFIG_FILE
+# Keep a local copy of the config file to preserve changes over "make clean"
+define BUSYBOX_COPY_CONFIG
+	test ! -f $(BUSYBOX_CONFIG_SAVE) && \
+		cp -f $(LOCAL_BUSYBOX_CONFIG_FILE) $(BUSYBOX_CONFIG_SAVE); \
+	cp -f $(BUSYBOX_CONFIG_SAVE) $(BUSYBOX_BUILD_CONFIG)
+endef
+else
+# When the environmant variable is present we always want to use this config file
 define BUSYBOX_COPY_CONFIG
 	cp -f $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
 endef
+endif
 
 # Disable shadow passwords support if unsupported by the C library
 ifeq ($(BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS),)
@@ -220,8 +234,10 @@ $(eval $(generic-package))
 busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch
 	$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(BUSYBOX_DIR) \
 		$(subst busybox-,,$@)
+	cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_SAVE)
 	rm -f $(BUSYBOX_DIR)/.stamp_built
 	rm -f $(BUSYBOX_DIR)/.stamp_target_installed
 
 busybox-update-config:
-	cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
+	cp -f $(BUSYBOX_BUILD_CONFIG) $(LOCAL_BUSYBOX_CONFIG_FILE)
+
Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
#3 lore raw

PATCH 2/2 Linux: save a copy of the config file

In reply to Stephan Hoffmann

"make linux-xconfig" stores the changes made in the build directory. Calling "make clean && make" later discards and replaces them with the default values. This is not what a user expects.

This patch saves a copy of the modified config file as $(TOPDIR)/linux-config and retrieves it from there after "make clean". $(TOPDIR)/linux-config is removed when a new defconfig is made.

For convenience we also copy the defconfig file to $(TOPDIR)/linux-defconfig after a "make linux-savedefconfig"

---
 Makefile       |    2 ++
 linux/linux.mk |   15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)
Makefile +2 -0
index 95ed683..af820ce 100644
@@ -674,11 +674,13 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	rm -f $(TOPDIR)/busybox-config
+	rm -f $(TOPDIR)/linux-config
 	@$(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
 	rm -f $(TOPDIR)/busybox-config
+	rm -f $(TOPDIR)/linux-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
linux/linux.mk +14 -1
index 91a9f50..18609b5 100644
@@ -155,8 +155,17 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
 endif
 
+# If we have a seved config file from a prevuios run we use this instead of the default one
+define LINUX_GET_SAVED_CONFIG
+	if [ -f $(TOPDIR)/linux-config ] ; then \
+		cp $(TOPDIR)/linux-config $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig; \
+	else \
+		cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig; \
+	fi
+endef
+
 define LINUX_CONFIGURE_CMDS
-	cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
+	$(call LINUX_GET_SAVED_CONFIG)
 	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(if $(BR2_ARM_EABI),
@@ -184,6 +193,7 @@ define LINUX_CONFIGURE_CMDS
 	$(if $(BR2_LINUX_KERNEL_APPENDED_DTB),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
 	yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
+	cp $(@D)/.config $(TOPDIR)/linux-config
 endef
 
 ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
@@ -272,11 +282,14 @@ ifeq ($(BR2_LINUX_KERNEL),y)
 linux-menuconfig linux-xconfig linux-gconfig linux-nconfig linux26-menuconfig linux26-xconfig linux26-gconfig linux26-nconfig: dirs linux-configure
 	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
 		$(subst linux-,,$(subst linux26-,,$@))
+	# copy the config file for later reference
+	cp $(LINUX_DIR)/.config $(TOPDIR)/linux-config
 	rm -f $(LINUX_DIR)/.stamp_{built,target_installed,images_installed}
 
 linux-savedefconfig linux26-savedefconfig: dirs linux-configure
 	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
 		$(subst linux-,,$(subst linux26-,,$@))
+	cp $(LINUX_DIR)/defconfig $(TOPDIR)/linux-defconfig
 
 ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 linux-update-config linux26-update-config: linux-configure $(LINUX_DIR)/.config
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 2/2 Linux: save a copy of the config file

Hi,

since this patch is obsolete I removed it from patchwork.

Regards

Stephan

Am 27.01.2013 17:11, schrieb Stephan Hoffmann:

Quoted 83 lines

"make linux-xconfig" stores the changes made in the build directory. Calling "make clean && make" later discards and replaces them with the default values. This is not what a user expects.

This patch saves a copy of the modified config file as $(TOPDIR)/linux-config and retrieves it from there after "make clean". $(TOPDIR)/linux-config is removed when a new defconfig is made.

For convenience we also copy the defconfig file to $(TOPDIR)/linux-defconfig after a "make linux-savedefconfig"

---
 Makefile       |    2 ++
 linux/linux.mk |   15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)
Makefile +2 -0
index 95ed683..af820ce 100644
@@ -674,11 +674,13 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	rm -f $(TOPDIR)/busybox-config
+	rm -f $(TOPDIR)/linux-config
 	@$(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
 	rm -f $(TOPDIR)/busybox-config
+	rm -f $(TOPDIR)/linux-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
linux/linux.mk +14 -1
index 91a9f50..18609b5 100644
@@ -155,8 +155,17 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
 endif
 
+# If we have a seved config file from a prevuios run we use this instead of the default one
+define LINUX_GET_SAVED_CONFIG
+	if [ -f $(TOPDIR)/linux-config ] ; then \
+		cp $(TOPDIR)/linux-config $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig; \
+	else \
+		cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig; \
+	fi
+endef
+
 define LINUX_CONFIGURE_CMDS
-	cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
+	$(call LINUX_GET_SAVED_CONFIG)
 	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(if $(BR2_ARM_EABI),
@@ -184,6 +193,7 @@ define LINUX_CONFIGURE_CMDS
 	$(if $(BR2_LINUX_KERNEL_APPENDED_DTB),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
 	yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
+	cp $(@D)/.config $(TOPDIR)/linux-config
 endef
 
 ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
@@ -272,11 +282,14 @@ ifeq ($(BR2_LINUX_KERNEL),y)
 linux-menuconfig linux-xconfig linux-gconfig linux-nconfig linux26-menuconfig linux26-xconfig linux26-gconfig linux26-nconfig: dirs linux-configure
 	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
 		$(subst linux-,,$(subst linux26-,,$@))
+	# copy the config file for later reference
+	cp $(LINUX_DIR)/.config $(TOPDIR)/linux-config
 	rm -f $(LINUX_DIR)/.stamp_{built,target_installed,images_installed}
 
 linux-savedefconfig linux26-savedefconfig: dirs linux-configure
 	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
 		$(subst linux-,,$(subst linux26-,,$@))
+	cp $(LINUX_DIR)/defconfig $(TOPDIR)/linux-defconfig
 
 ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 linux-update-config linux26-update-config: linux-configure $(LINUX_DIR)/.config
Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
#5 lore raw
In reply to Stephan Hoffmann
Quoted 8 lines · Stephan Hoffmann

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 6 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

This is a bit a philosophical discussion: should the configuration
files of linux, busybox, etc. be considered part of the buildroot configuration or not? In the former case, they should survive a 'make clean', in the latter case they should be removed by 'make clean'.

I tend to agree that the package configs should be considered part of
the buildroot config. However, if your buildroot config specifies some BR2_PACKAGE_BUSYBOX_CONFIG, then I would expect that after 'make clean', that is the config that will be used. More generically, I expect I can do:

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

and to be back in the same state as 'make foo_defconfig; make'.

Bottom line: I tend to say no to this patch.

Quoted 3 lines

I have prepared two patches that save these config files in $(TOPDIR), where buildroot's own config file lives. After "make clean", these files are used instead of those named in the buildroot config.

  buildroot's own config lives in $(CONFIG_DIR).

Regards,
Arnout

Quoted 12 lines

Calling "make xxx-defconfig" removes the saved config files, so that again the configuration from buildroot's config file is used.

The same issue appears with uClibc, ct-ng and probably others, but I do not think that many users modify these settings.

If these patches get accepted I will update the documentation, too.

Kind regards

Stephan

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
#6 lore raw
Quoted 9 lines

More generically, I expect I
can do:

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

I'd tend to disagree on that one...

when using the kernel (or buildroot for that matter) that sequence would use your .config configuration, not the foo_defconfig

to get the foo_defconfig back in place the sequence would be

make foo_defconfig
<weird stuff>
make clean
make foo_defconfig
make

you need that call to override your .config and I think that's the behaviour people would expect i.e the philosophy would be

"make clean doesn't touch your configuration, only explicit make targets are allowed to touch your configuration"

would it make sense to have a "kconfig-target" generic infrastructure in buildroot for all packages that use kconfig like configuration ?

Regards
J?r?my

#7 lore raw
In reply to Arnout Vandecappelle

Am 27.01.2013 23:36, schrieb Arnout Vandecappelle:

Quoted 17 lines · Stephan Hoffmann
Quoted 8 lines

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 7 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

Quoted 4 lines

This is a bit a philosophical discussion: should the configuration
files of linux, busybox, etc. be considered part of the buildroot configuration or not? In the former case, they should survive a 'make clean', in the latter case they should be removed by 'make clean'.

Hello Arnout,

this is the inconsistency I am pointing to. On the one hand, some "initial" config for Linux, Busybox and so on are needed. On the other hand, buildroot provides means to tweak these config files so the tweaked ones should at least be usable.

"make xconfig && make clean && make" is the general workflow for tweaking buildroot with the option to leave out "make clean" if one knows that it isn't needed.

"make busybox-xconfig && make clean & make" just does nothing.

There are undocumented xxx-update-config make targets around, but these replace the config files stored in the packet directories and thus have a "make savedefconfig && cp defconfig configs/xxx-defconfig" semantic neaning that in case messing up the config only git helps to get out since the original config files are gone.

Quoted 5 lines

I tend to agree that the package configs should be considered part of
the buildroot config. However, if your buildroot config specifies some BR2_PACKAGE_BUSYBOX_CONFIG, then I would expect that after 'make clean', that is the config that will be used.

What is your workflow when tweaking Linux or busybox configuration for a given project?

My treferred workflow would be:

make xxx-defconfig
do one of
make xconfig
make linux-xconfig
make busybox-xconfig
make clean
make
tweak script to finalize filesysten
until the system works as expected
make savedefconfig
save buildroot, busybox and linux config files to a project-specific place

Quoted 6 lines

More generically, I expect I can do:

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

In this case you end up with changes in buildroot's config preserved and all others discarded. Last but not least "make clean" is not only needed after messing things up, but also, for example, when switching some system application from busybox to the generic version or vice versa.

Quoted 2 lines

and to be back in the same state as 'make foo_defconfig; make'.

That would be the case with my patches.

Quoted 9 lines

Bottom line: I tend to say no to this patch.

Quoted 3 lines

I have prepared two patches that save these config files in $(TOPDIR), where buildroot's own config file lives. After "make clean", these files are used instead of those named in the buildroot config.

buildroot's own config lives in $(CONFIG_DIR).

That's right, thank you. I missed this and will correct my parches.

Regards

Stephan

Quoted 19 lines

Regards,
Arnout

Quoted 12 lines

Calling "make xxx-defconfig" removes the saved config files, so that again the configuration from buildroot's config file is used.

The same issue appears with uClibc, ct-ng and probably others, but I do not think that many users modify these settings.

If these patches get accepted I will update the documentation, too.

Kind regards

Stephan

#8 lore raw
In reply to Arnout Vandecappelle
Quoted 27 lines · Arnout Vandecappelle
Quoted 8 lines · Stephan Hoffmann

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 7 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

This is a bit a philosophical discussion: should the configuration
files of linux, busybox, etc. be considered part of the buildroot configuration or not? In the former case, they should survive a 'make clean', in the latter case they should be removed by 'make clean'.

I tend to agree that the package configs should be considered part of
the buildroot config. However, if your buildroot config specifies some BR2_PACKAGE_BUSYBOX_CONFIG, then I would expect that after 'make clean', that is the config that will be used. More generically, I expect I can do:

Quoted 8 lines

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

and to be back in the same state as 'make foo_defconfig; make'.

I'd like the busybox-*config and linux-*config targets should save the resulting config in BR2_PACKAGE_BUSYBOX_CONFIG and BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE. I keep these two locations under source control in board/my_company/board_name/, so when I completely mess up the config, it's just a git checkout path/to/config, and if I want to keep the changes, I just add and commit the file. It also lets me clearly see something has changed when I run git status.

#9 lore raw

Am 29.01.2013 01:16, schrieb Shawn J. Goff:

Quoted 40 lines · Arnout Vandecappelle
Quoted 28 lines · Stephan Hoffmann
Quoted 8 lines

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 7 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

This is a bit a philosophical discussion: should the configuration
files of linux, busybox, etc. be considered part of the buildroot configuration or not? In the former case, they should survive a 'make clean', in the latter case they should be removed by 'make clean'.

I tend to agree that the package configs should be considered part of
the buildroot config. However, if your buildroot config specifies some BR2_PACKAGE_BUSYBOX_CONFIG, then I would expect that after 'make clean', that is the config that will be used. More generically, I expect I can do:

Quoted 8 lines

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

and to be back in the same state as 'make foo_defconfig; make'.

Quoted 7 lines

I'd like the busybox-*config and linux-*config targets should save the resulting config in BR2_PACKAGE_BUSYBOX_CONFIG and BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE. I keep these two locations under source control in board/my_company/board_name/, so when I completely mess up the config, it's just a git checkout path/to/config, and if I want to keep the changes, I just add and commit the file. It also lets me clearly see something has changed when I run git status.

Do you know about busybox-update-config and linux-update-config?

Quoted 6 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#10 lore raw
Quoted 41 lines · Stephan Hoffmann

Am 29.01.2013 01:16, schrieb Shawn J. Goff:

Quoted 40 lines · Arnout Vandecappelle
Quoted 36 lines · Stephan Hoffmann
Quoted 8 lines

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 7 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

This is a bit a philosophical discussion: should the configuration
files of linux, busybox, etc. be considered part of the buildroot configuration or not? In the former case, they should survive a 'make clean', in the latter case they should be removed by 'make clean'.

I tend to agree that the package configs should be considered part of
the buildroot config. However, if your buildroot config specifies some BR2_PACKAGE_BUSYBOX_CONFIG, then I would expect that after 'make clean', that is the config that will be used. More generically, I expect I can do:

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

and to be back in the same state as 'make foo_defconfig; make'.

Quoted 8 lines
Quoted 7 lines

I'd like the busybox-*config and linux-*config targets should save the resulting config in BR2_PACKAGE_BUSYBOX_CONFIG and BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE. I keep these two locations under source control in board/my_company/board_name/, so when I completely mess up the config, it's just a git checkout path/to/config, and if I want to keep the changes, I just add and commit the file. It also lets me clearly see something has changed when I run git status.

Do you know about busybox-update-config and linux-update-config?

I did not. I also see a barebox-update-config and a uClibc-update-config. Why should those not get called by the make *-config targets? One of the goals of Buildroot is to ensure consistent, repeatable builds. If it's easy for me to do a make linux-menuconfig and go on working without it reminding me that I've changed something and it's not committed yet, I think that's a bug.

#11 lore raw
In reply to Arnout Vandecappelle
Quoted 32 lines · Arnout Vandecappelle
Quoted 8 lines · Stephan Hoffmann

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 7 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

This is a bit a philosophical discussion: should the configuration
files of linux, busybox, etc. be considered part of the buildroot configuration or not? In the former case, they should survive a 'make clean', in the latter case they should be removed by 'make clean'.

I tend to agree that the package configs should be considered part of
the buildroot config. However, if your buildroot config specifies some BR2_PACKAGE_BUSYBOX_CONFIG, then I would expect that after 'make clean', that is the config that will be used. More generically, I expect I can do:

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

Quoted 4 lines

and to be back in the same state as 'make foo_defconfig; make'.

Bottom line: I tend to say no to this patch.

After the feedback from Real Users (Stephan, Jeremy, Shawn), it looks
like I have to revise my opinion...

Or are there any other voices against?

If this does go through, I would like to have some way to throw away
the customized config and revert to the configured config. Perhaps a 'realclean' target?

Regards,
Arnout

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
#12 lore raw
Quoted 16 lines
Quoted 10 lines

make foo_defconfig
Do all kinds of weird stuff that completely messes things up make clean
make

and to be back in the same state as 'make foo_defconfig; make'.

Bottom line: I tend to say no to this patch.

After the feedback from Real Users (Stephan, Jeremy, Shawn), it looks
like I have to revise my opinion...

Quoted 8 lines

Or are there any other voices against?

If this does go through, I would like to have some way to throw away
the customized config and revert to the configured config. Perhaps a 'realclean' target?

I am not sure what you mean by "the configured" vs "the customized"

I guess that the customized is the one from make linux-menuconfig and the configured is the one from make foo_defconfig

hmm, I see your use case.... I would tend to argue that the kernel is no exception to the way buildroot works

* make clean removes all build-generated but doesn't touch user-defined configurations (BR configuration, kernel configuration)
* to revert to BR's suggested configuration, use make xxx_defconfig, and that would override both the kernel and BR's configuration.

I don't really see a use-case for "revert my changes to the kernel, but not the rest of buildroot" though providing targets like make linux-xxx_defconfig for all kernel defined defconfig and/or a make linux-buildrootconfig to revert to the buildroot-suggested config might make sense...

Best
J?r?my

#13 lore raw
Quoted 10 lines · Jeremy Rosen
Quoted 6 lines

If this does go through, I would like to have some way to throw away
the customized config and revert to the configured config. Perhaps a 'realclean' target?

I am not sure what you mean by "the configured" vs "the customized"

I guess that the customized is the one from make linux-menuconfig and the configured is the one from make foo_defconfig

Not from 'make foo_defconfig', but from 'make menuconfig'.

If in the buildroot config I select 'Use omap2plus defconfig' for the
kernel, then I expect it to use the omap2plus configuration. Similarly, if I set the custom linux config to /some/path/linux.config, then I expect that that configuration will be used.

So 'configured' is what you see in 'make menuconfig', 'customized' is
what you see in 'make linux-menuconfig'.

Quoted 3 lines

hmm, I see your use case.... I would tend to argue that the kernel is no exception to the way buildroot works

* make clean removes all build-generated but doesn't touch user-defined configurations (BR configuration, kernel configuration)

But the problem is that the buildroot configuration conflicts with the
kernel configuration.

Regards,
Arnout

Quoted 9 lines

* to revert to BR's suggested configuration, use make xxx_defconfig, and that would override both the kernel and BR's configuration.

I don't really see a use-case for "revert my changes to the kernel, but not the rest of buildroot" though providing targets like make linux-xxx_defconfig for all kernel defined defconfig and/or a make linux-buildrootconfig to revert to the buildroot-suggested config might make sense...

Best
J?r?my

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
#14 lore raw
Quoted 9 lines

But the problem is that the buildroot configuration conflicts with the
kernel configuration.

Regards,
Arnout

aha....

so our problem is that make linux-menuconfig should change the buildroot configuration option from "use defconfig" to "use a custom configuration"

is that it ?

#15 lore raw

Am 30.01.2013 11:01, schrieb Jeremy Rosen:

Quoted 9 lines
Quoted 8 lines

But the problem is that the buildroot configuration conflicts with the
kernel configuration.

Regards,
Arnout

Quoted 5 lines

aha....

so our problem is that make linux-menuconfig should change the buildroot configuration option from "use defconfig" to "use a custom configuration"

is that it ?

I don't think so. If we regard the buildroot configuration option more as a starting point for configuring busybox and linux than as the actual used value, we are right there:

After "make xxx_defconfig" we have the default configuration. "make xxx-menuconfig" takes us to a temporary "work in progress" point, where our system no longer matches the default configuration but is defined by .config, busybox-config and linux-config.
"make xxx_defconfig && make clean" discards all changes and restores the default configuration.
"make xxx-update-config" updates the config file named in buildroot's config file constituting a new default.
"make savedefconfig && cp defconfig configs/xxx_defconfig" does the same for the changes in buildroot's config file.

Maybe it makes sense to change some names?

BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE -> BR2_LINUX_KERNEL_DEFAULT_CONFIG_FILE BR2_PACKAGE_BUSYBOX_CONFIG -> BR2_PACKAGE_BUSYBOX_DEFAULT_CONFIG

Regards

Stephan

Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
#16 lore raw
In reply to Stephan Hoffmann

2013/1/27 Stephan Hoffmann <[email protected]>:

Quoted 8 lines

Hello all,

buildroot provides direct calls to the configuration menus for busybox and linux:

make linux-menuconfig
make busybox-menuconfig

Quoted 7 lines

Additionally, there is a linux-savedefconfig make target.

All these save their output in the build directory, so that all changes get lost when "make clean" is called. Thus I don't think that I am the only one who has been surprised to notice that "make busybox-menuconfig && make clean && make" does not have any effect on busybox's configuration.

I have been bitten by this recently and it is a real bad surprise when :
_ you lost days figuring out how the hell the option that should save you has no effect on your porblem
_ you lost what you did in your configs ...

It may simply be a matter of documentation, but it's really a pain to learn that this way.

Quoted 26 lines

I have prepared two patches that save these config files in $(TOPDIR), where buildroot's own config file lives. After "make clean", these files are used instead of those named in the buildroot config.

Calling "make xxx-defconfig" removes the saved config files, so that again the configuration from buildroot's config file is used.

The same issue appears with uClibc, ct-ng and probably others, but I do not think that many users modify these settings.

If these patches get accepted I will update the documentation, too.

Kind regards

Stephan

--
reLinux - Stephan Hoffmann
Am Schmidtgrund 124 50765 K?ln
Tel. +49.221.95595-19 Fax: -64
www.reLinux.de sho at reLinux.de

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot