[source] build: fix symlinked .config handling

LEDE Commits lede-commits at lists.infradead.org
Tue May 2 07:11:17 PDT 2017


jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/37cf92135272e3892b61335725c291a8828ea2c0

commit 37cf92135272e3892b61335725c291a8828ea2c0
Author: Sergey Ryazanov <ryazanov.s.a at gmail.com>
AuthorDate: Thu Apr 20 05:10:45 2017 +0300

    build: fix symlinked .config handling
    
    When running "make menuconfig" with symlinked .config (e.g. to
    env/.config) it renames symlink to .config.old, creates new .config file
    and writes updated configuration here.
    
    This breaks the desired workflow when changes in the configuration could
    be checked using "scripts/env diff" and commited with
    "scripts/env save". Since the env/.config file is not updated.
    
    Fix this issue by exporting KCONFIG_OVERWRITECONFIG=1, which forces
    mconf to overwrite the .config content, instead of renaming it and
    creating a new file. This variable is set only if .config is a symlink,
    otherwise the variable is not exported and the old behaviour is
    preserved.
    
    Signed-off-by: Sergey Ryazanov <ryazanov.s.a at gmail.com>
---
 include/toplevel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index 24e4ebf..c90670b 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -126,7 +126,7 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
 	if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
 		cp $(HOME)/.openwrt/defconfig .config; \
 	fi
-	$< Config.in
+	[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; $< Config.in
 
 prepare_kernel_conf: .config FORCE
 



More information about the lede-commits mailing list