linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] kbuild: More KCONFIG_CONFIG ignorance
@ 2019-03-04 16:57 Arseny Maslennikov
  2019-03-04 16:57 ` [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG Arseny Maslennikov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arseny Maslennikov @ 2019-03-04 16:57 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Jeff Dike, Richard Weinberger,
	Anton Ivanov
  Cc: Arseny Maslennikov, linux-kbuild, linux-kernel, linux-um

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(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG
  2019-03-04 16:57 [PATCH 0/3] kbuild: More KCONFIG_CONFIG ignorance Arseny Maslennikov
@ 2019-03-04 16:57 ` Arseny Maslennikov
  2019-03-11 17:16   ` Masahiro Yamada
  2019-03-04 16:57 ` [PATCH 2/3] Makefile: kselftest: " Arseny Maslennikov
  2019-03-04 16:57 ` [PATCH 3/3] arch/um/kernel/Makefile: " Arseny Maslennikov
  2 siblings, 1 reply; 6+ messages in thread
From: Arseny Maslennikov @ 2019-03-04 16:57 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Jeff Dike, Richard Weinberger,
	Anton Ivanov
  Cc: Arseny Maslennikov, linux-kbuild, linux-kernel, linux-um

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.

Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
---
 scripts/kconfig/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 1c7ac07def4d..28be91964a20 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] Makefile: kselftest: use KCONFIG_CONFIG
  2019-03-04 16:57 [PATCH 0/3] kbuild: More KCONFIG_CONFIG ignorance Arseny Maslennikov
  2019-03-04 16:57 ` [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG Arseny Maslennikov
@ 2019-03-04 16:57 ` Arseny Maslennikov
  2019-03-11 17:25   ` Masahiro Yamada
  2019-03-04 16:57 ` [PATCH 3/3] arch/um/kernel/Makefile: " Arseny Maslennikov
  2 siblings, 1 reply; 6+ messages in thread
From: Arseny Maslennikov @ 2019-03-04 16:57 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Jeff Dike, Richard Weinberger,
	Anton Ivanov
  Cc: Arseny Maslennikov, linux-kbuild, linux-kernel, linux-um

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.

Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d5713e7b1e50..4d8760166a47 100644
--- a/Makefile
+++ b/Makefile
@@ -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
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] arch/um/kernel/Makefile: use KCONFIG_CONFIG
  2019-03-04 16:57 [PATCH 0/3] kbuild: More KCONFIG_CONFIG ignorance Arseny Maslennikov
  2019-03-04 16:57 ` [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG Arseny Maslennikov
  2019-03-04 16:57 ` [PATCH 2/3] Makefile: kselftest: " Arseny Maslennikov
@ 2019-03-04 16:57 ` Arseny Maslennikov
  2 siblings, 0 replies; 6+ messages in thread
From: Arseny Maslennikov @ 2019-03-04 16:57 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Jeff Dike, Richard Weinberger,
	Anton Ivanov
  Cc: Arseny Maslennikov, linux-kbuild, linux-kernel, linux-um

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.

Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
---
 arch/um/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 2f36d515762e..f5afd186a0ab 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -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   $@
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG
  2019-03-04 16:57 ` [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG Arseny Maslennikov
@ 2019-03-11 17:16   ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-03-11 17:16 UTC (permalink / raw)
  To: Arseny Maslennikov
  Cc: Michal Marek, Jeff Dike, Richard Weinberger, Anton Ivanov,
	Linux Kbuild mailing list, Linux Kernel Mailing List, linux-um

On Tue, Mar 5, 2019 at 1:58 AM Arseny Maslennikov <ar@cs.msu.ru> wrote:
>
> 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.




> Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
> ---
>  scripts/kconfig/Makefile | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index 1c7ac07def4d..28be91964a20 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -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
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] Makefile: kselftest: use KCONFIG_CONFIG
  2019-03-04 16:57 ` [PATCH 2/3] Makefile: kselftest: " Arseny Maslennikov
@ 2019-03-11 17:25   ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-03-11 17:25 UTC (permalink / raw)
  To: Arseny Maslennikov
  Cc: Michal Marek, Jeff Dike, Richard Weinberger, Anton Ivanov,
	Linux Kbuild mailing list, Linux Kernel Mailing List, linux-um

On Tue, Mar 5, 2019 at 1:58 AM Arseny Maslennikov <ar@cs.msu.ru> wrote:
>
> 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.
>
> Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index d5713e7b1e50..4d8760166a47 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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.








>                 $(srctree)/tools/testing/selftests/*/config
>         +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
>
> --
> 2.20.1
>


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-11 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 16:57 [PATCH 0/3] kbuild: More KCONFIG_CONFIG ignorance Arseny Maslennikov
2019-03-04 16:57 ` [PATCH 1/3] kconfig/Makefile: localmodconfig: use KCONFIG_CONFIG Arseny Maslennikov
2019-03-11 17:16   ` Masahiro Yamada
2019-03-04 16:57 ` [PATCH 2/3] Makefile: kselftest: " Arseny Maslennikov
2019-03-11 17:25   ` Masahiro Yamada
2019-03-04 16:57 ` [PATCH 3/3] arch/um/kernel/Makefile: " Arseny Maslennikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).