Bug 7154 - Local uClibc config file gets overwritten using make uclibc-update-config
Summary: Local uClibc config file gets overwritten using make uclibc-update-config
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2014.05
Hardware: PC Windows
: P5 major
Target Milestone: 2014.08
Assignee: Thomas De Schampheleire
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 12:36 UTC by oliver.kasten
Modified: 2014-07-30 20:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description oliver.kasten 2014-06-03 12:36:18 UTC
I've defined an external place for the uClibc config file using BR_UCLIBC_CONFIG. After editing the configuration with make uclibc-menuconfig I want to copy the edited config file with make uclibc-update-config to the external place.

It seems that before copying the config file to the external place, it gets re-configured using the UCLIBC_CONFIGURE_CMDS, which overwrites the local config file with the external file.

For me deleting the .stamp_configured file in the uclibc-menuconfig entry of the makefile seems not to be a good idea.
Comment 1 Thomas De Schampheleire 2014-06-10 13:22:07 UTC
Bug confirmed.
Procedure is:

make uclibc-menuconfig   (make a change)
(change is reflected in output/build/uclibc-.../.config)
make uclibc-update-config
(cp custom.config output/build/uclibc-.../.config, overwriting last change)
(do configuration actions)
(cp output/build/uclibc-.../.config custom.config)

Problem may be present for busybox and linux too...
Comment 2 Thomas De Schampheleire 2014-06-10 13:56:04 UTC
(In reply to comment #0)
[..]
> 
> For me deleting the .stamp_configured file in the uclibc-menuconfig entry of
> the makefile seems not to be a good idea.

This is done so that the uclibc build is correctly restarted, taking into account some of the configuration changes we make on the fly.

The following patch solves the problem, but I'm not sure this is acceptable.
It moves the initial copy of the config file outside of the UCLIBC_SETUP_DOT_CONFIG variable, so that this variable can be re-used from the uclibc-update-config target. Because this variable relies on $(@D) we need it to be run for a target inside the UCLIBC_DIR, so the patch introduces a new .stamp_config_file_fixed step.

tdescham@argentina ~/repo/contrib/buildroot-patchwork $ hg diff
diff -r a3b89cb15e8f package/uclibc/uclibc.mk
--- a/package/uclibc/uclibc.mk  Mon Jun 09 10:43:55 2014 +0200
+++ b/package/uclibc/uclibc.mk  Tue Jun 10 15:52:36 2014 +0200
@@ -414,7 +414,6 @@
        HOSTCC="$(HOSTCC)"
 
 define UCLIBC_SETUP_DOT_CONFIG
-       $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
        $(call UCLIBC_OPT_SET,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D))
        $(call UCLIBC_OPT_SET,TARGET_$(UCLIBC_TARGET_ARCH),y,$(@D))
        $(call UCLIBC_OPT_SET,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D))
@@ -454,6 +453,7 @@
 endef
 
 define UCLIBC_CONFIGURE_CMDS
+       $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
        $(UCLIBC_SETUP_DOT_CONFIG)
        $(MAKE1) -C $(UCLIBC_DIR) \
                $(UCLIBC_MAKE_FLAGS) \
@@ -553,7 +553,10 @@
 
 $(eval $(generic-package))
 
-uclibc-update-config: $(UCLIBC_DIR)/.stamp_configured
+$(UCLIBC_DIR)/.stamp_config_file_fixed:
+       $(UCLIBC_SETUP_DOT_CONFIG)
+
+uclibc-update-config: $(UCLIBC_DIR)/.stamp_config_file_fixed
        cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
 # Before uClibc is built, we must have the second stage cross-compiler
Comment 4 Thomas De Schampheleire 2014-07-30 20:03:21 UTC
Fixed with commit http://git.buildroot.org/buildroot/commit/?id=8b8a60cd52c6350e346f9783863d362eeccf82b6

Thanks for reporting!