Skip to contentSkip to conversation

kbuild: More KCONFIG_CONFIG ignorance

PATCH In review Arseny Maslennikov 2 participants 6 messages Mar 4, 2019 – Mar 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 1c7ac07def4d..28be91964a20 100644
@@ -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
#2 lore raw

Re: [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG

Quoted 5 lines · Arseny Maslennikov

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.

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
---
 scripts/kconfig/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/kconfig/Makefile +6 -7
index 1c7ac07def4d..28be91964a20 100644
@@ -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
#3 lore raw

PATCH 2/3 Makefile: kselftest: use KCONFIG_CONFIG

In reply to Arseny Maslennikov

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.

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index d5713e7b1e50..4d8760166a47 100644
@@ -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
#4 lore raw

Re: [PATCH 2/3] Makefile: kselftest: use KCONFIG_CONFIG

Quoted 16 lines · Arseny Maslennikov

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.

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +0 -0
index d5713e7b1e50..4d8760166a47 100644

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

#5 lore raw

PATCH 3/3 arch/um/kernel/Makefile: use KCONFIG_CONFIG

In reply to Arseny Maslennikov

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.

---
 arch/um/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/Makefile +1 -1
index 2f36d515762e..f5afd186a0ab 100644
@@ -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