kbuild: More KCONFIG_CONFIG ignorance
Subsystems (3)
cover kbuild: More KCONFIG_CONFIG ignorance
Following a recent bug with make *config' not supporting a redefined kernel config file, I ran a git grep -w -nE [.]config **/Makefile' and discovered these:
Arseny Maslennikov (3):
kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG
Makefile: kselftest: use KCONFIG_CONFIG arch/um/kernel/Makefile: use KCONFIG_CONFIG
Makefile | 4 ++-- arch/um/kernel/Makefile | 2 +- scripts/kconfig/Makefile | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/3 kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG
If the config file is reassigned through the KCONFIG_CONFIG makeflag/envvar, this rule still attempts to use the wrong, possibly nonexistent file.
Let's fix that.
--- scripts/kconfig/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/kconfig/Makefile +6 -6
@@ -44,14 +44,14 @@ build_xconfig: $(obj)/qconf localyesconfig localmodconfig: $(obj)/conf $(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config - $(Q)if [ -f .config ]; then \ - cmp -s .tmp.config .config || \ - (mv -f .config .config.old.1; \ - mv -f .tmp.config .config; \ + $(Q)if [ -f $(KCONFIG_CONFIG) ]; then \ + cmp -s .tmp.config $(KCONFIG_CONFIG) || \ + (mv -f $(KCONFIG_CONFIG) .tmp.config.old.1; \ + mv -f .tmp.config $(KCONFIG_CONFIG); \ $< $(silent) --oldconfig $(Kconfig); \ - mv -f .config.old.1 .config.old) \ + mv -f .tmp.config.old.1 $(KCONFIG_CONFIG).old) \ else \ - mv -f .tmp.config .config; \ + mv -f .tmp.config $(KCONFIG_CONFIG); \ $< $(silent) --oldconfig $(Kconfig); \ fi $(Q)rm -f .tmp.config
Signature · 1 line
2.20.1
Re: [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG
Quoted 5 lines · Arseny Maslennikov
If the config file is reassigned through the
KCONFIG_CONFIGmakeflag/envvar, this rule still attempts to use the wrong, possibly nonexistent file.
Let's fix that.
Are you just replacing .config with KCONFIG_CONFIG at random?
scripts/kconfig/streamline_config.pl
hard-codes the .config path,
so this does not work anyway.
Quoted 33 lines
Signed-off-by Arseny Maslennikov <[email protected]>--- scripts/kconfig/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)scripts/kconfig/Makefile +6
-7@@ -44,14 +44,14 @@ build_xconfig: $(obj)/qconf localyesconfig localmodconfig: $(obj)/conf $(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config - $(Q)if [ -f .config ]; then \ - cmp -s .tmp.config .config || \ - (mv -f .config .config.old.1; \ - mv -f .tmp.config .config; \ + $(Q)if [ -f $(KCONFIG_CONFIG) ]; then \ + cmp -s .tmp.config $(KCONFIG_CONFIG) || \ + (mv -f $(KCONFIG_CONFIG) .tmp.config.old.1; \ + mv -f .tmp.config $(KCONFIG_CONFIG); \ $< $(silent) --oldconfig $(Kconfig); \ - mv -f .config.old.1 .config.old) \ + mv -f .tmp.config.old.1 $(KCONFIG_CONFIG).old) \ else \ - mv -f .tmp.config .config; \ + mv -f .tmp.config $(KCONFIG_CONFIG); \ $< $(silent) --oldconfig $(Kconfig); \ fi $(Q)rm -f .tmp.config --2.20.1
Signature · 2 lines
Best Regards Masahiro Yamada
PATCH 2/3 Makefile: kselftest: use KCONFIG_CONFIG
In reply to Arseny MaslennikovIf the config file is reassigned through the KCONFIG_CONFIG makeflag/envvar, this rule still attempts to use the wrong, possibly nonexistent file.
Let's fix that.
--- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
@@ -1199,9 +1199,9 @@ kselftest-clean: PHONY += kselftest-merge kselftest-merge: - $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!)) + $(if $(wildcard $(objtree)/$(KCONFIG_CONFIG)),, $(error No $(KCONFIG_CONFIG) exists, config your kernel first!)) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \ - -m $(objtree)/.config \ + -m $(objtree)/$(KCONFIG_CONFIG) \ $(srctree)/tools/testing/selftests/*/config +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
Signature · 1 line
2.20.1
Re: [PATCH 2/3] Makefile: kselftest: use KCONFIG_CONFIG
Quoted 16 lines · Arseny Maslennikov
If the config file is reassigned through the
KCONFIG_CONFIGmakeflag/envvar, this rule still attempts to use the wrong, possibly nonexistent file.
Let's fix that.Signed-off-by Arseny Maslennikov <[email protected]>--- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Makefile +0
-0
Makefile kselftest-clean: · line 1204
Quoted 8 lines
Makefile +2
-2@@ -1199,9 +1199,9 @@ kselftest-clean: PHONY += kselftest-merge kselftest-merge: - $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!)) + $(if $(wildcard $(objtree)/$(KCONFIG_CONFIG)),, $(error No $(KCONFIG_CONFIG) exists, config your kernel first!)) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \ - -m $(objtree)/.config \ + -m $(objtree)/$(KCONFIG_CONFIG) \
You are blindly replacing .config with $(KCONFIG_CONFIG).
What kind of usage do you assume for KCONFIG_CONFIG ?
$(objtree)/$(KCONFIG_CONFIG) means
$(KCONFIG_CONFIG) never becomes an absolute path.
Quoted 6 lines
Makefile +0
-1$(srctree)/tools/testing/selftests/*/config +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig --2.20.1
--
Best Regards
Masahiro Yamada
PATCH 3/3 arch/um/kernel/Makefile: use KCONFIG_CONFIG
In reply to Arseny MaslennikovIf the config file is reassigned through the KCONFIG_CONFIG makeflag/envvar, this rule still attempts to use the wrong, possibly nonexistent file.
Let's fix that.
--- arch/um/kernel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/Makefile +1 -1
@@ -35,7 +35,7 @@ targets := config.c config.tmp # Be careful with the below Sed code - sed is pitfall-rich! # We use sed to lower build requirements, for "embedded" builders for instance. -$(obj)/config.tmp: $(objtree)/.config FORCE +$(obj)/config.tmp: $(objtree)/$(KCONFIG_CONFIG) FORCE $(call if_changed,quote1) quiet_cmd_quote1 = QUOTE $@
Signature · 1 line
2.20.1