2019-03-04 17:15:19

by Arseny Maslennikov

[permalink] [raw]
Subject: [PATCH 0/3] 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(-)

--
2.20.1



2019-03-04 17:15:28

by Arseny Maslennikov

[permalink] [raw]
Subject: [PATCH 2/3] Makefile: kselftest: 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.

Signed-off-by: Arseny Maslennikov <[email protected]>
---
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


2019-03-04 17:15:51

by Arseny Maslennikov

[permalink] [raw]
Subject: [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.

Signed-off-by: Arseny Maslennikov <[email protected]>
---
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


2019-03-04 18:16:17

by Arseny Maslennikov

[permalink] [raw]
Subject: [PATCH 3/3] arch/um/kernel/Makefile: 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.

Signed-off-by: Arseny Maslennikov <[email protected]>
---
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


2019-03-11 17:19:06

by Masahiro Yamada

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

On Tue, Mar 5, 2019 at 1:58 AM Arseny Maslennikov <[email protected]> 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 <[email protected]>
> ---
> 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

2019-03-11 17:27:41

by Masahiro Yamada

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

On Tue, Mar 5, 2019 at 1:58 AM Arseny Maslennikov <[email protected]> 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 <[email protected]>
> ---
> 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