public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] kbuild: find kernel/configs for fragments in fragment merging
@ 2024-01-13  0:11 Zhang Bingwu
  2024-01-13  0:11 ` [PATCH 1/1] " Zhang Bingwu
  2024-01-14  8:13 ` [PATCH v2 0/2] kbuild: find kernel/configs for merged fragments Zhang Bingwu
  0 siblings, 2 replies; 7+ messages in thread
From: Zhang Bingwu @ 2024-01-13  0:11 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Zhang Bingwu

From: Zhang Bingwu <xtexchooser@duck.com>

Function merge_into_defconfig and merge_into_defconfig_override merge
 a defconfig with several fragments, which should also be searched for
 in kernel/configs/*.config.
When using 'make xxx_defconfig xxx.config' to merge fragments,
 scripts/kconfig/Makefile also searches kernel/configs/*.config
 for fragments.

This patch also switched usages of ARCH to SRCARCH.
For some ARCH values, such as i386 and x86_64, SRCARCH is different
 from ARCH and arch/$(ARCH) does not exist anymore.
If the two functions are used in these ARCHs which has
 a different SRCARCH, kbuild may fail to find fragments.

Zhang Bingwu (1):
  kbuild: find kernel/configs for fragments in fragment merging

 scripts/Makefile.defconf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.43.0


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

* [PATCH 1/1] kbuild: find kernel/configs for fragments in fragment merging
  2024-01-13  0:11 [PATCH 0/1] kbuild: find kernel/configs for fragments in fragment merging Zhang Bingwu
@ 2024-01-13  0:11 ` Zhang Bingwu
  2024-01-14  8:13 ` [PATCH v2 0/2] kbuild: find kernel/configs for merged fragments Zhang Bingwu
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang Bingwu @ 2024-01-13  0:11 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Zhang Bingwu

From: Zhang Bingwu <xtexchooser@duck.com>

Function merge_into_defconfig and merge_into_defconfig_override merge
a defconfig with several fragments, which should also be searched for
in kernel/configs/*.config.

This also switched ARCH to $(SRCARCH).
For some ARCH, SRCARCH is different from ARCH and arch/$(ARCH) does not
exist.

Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>
---
 scripts/Makefile.defconf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.defconf b/scripts/Makefile.defconf
index ab271b205..6e61c1784 100644
--- a/scripts/Makefile.defconf
+++ b/scripts/Makefile.defconf
@@ -10,7 +10,7 @@
 define merge_into_defconfig
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
 		-m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
-		$(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
+		$(foreach config,$(2),$(wildcard $(srctree)/kernel/configs/$(config).config $(srctree)/arch/$(SRCARCH)/configs/$(config).config))
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
 
@@ -24,6 +24,6 @@ endef
 define merge_into_defconfig_override
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
 		-Q -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
-		$(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
+		$(foreach config,$(2),$(wildcard $(srctree)/kernel/configs/$(config).config $(srctree)/arch/$(SRCARCH)/configs/$(config).config))
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
-- 
2.43.0


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

* [PATCH v2 0/2] kbuild: find kernel/configs for merged fragments
  2024-01-13  0:11 [PATCH 0/1] kbuild: find kernel/configs for fragments in fragment merging Zhang Bingwu
  2024-01-13  0:11 ` [PATCH 1/1] " Zhang Bingwu
@ 2024-01-14  8:13 ` Zhang Bingwu
  2024-01-14  8:13   ` [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs Zhang Bingwu
  2024-01-14  8:14   ` [PATCH v2 2/2] kbuild: find kernel/configs/ for merged fragments Zhang Bingwu
  1 sibling, 2 replies; 7+ messages in thread
From: Zhang Bingwu @ 2024-01-14  8:13 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nick Desaulniers,
	Nicolas Schier, linux-kbuild, linux-kernel
  Cc: Zhang Bingwu

From: Zhang Bingwu <xtexchooser@duck.com>

First patch changed usages of ARCH to SRCARCH.
For some ARCH values, such as i386 and x86_64, SRCARCH is different 
from ARCH and arch/$(ARCH) does not exist.

Config fragments merged by  merge_into_defconfig and 
merge_into_defconfig_override should also be searched for 
in kernel/configs/*.config.
When using 'make xxx_defconfig xxx.config' to merge fragments,
scripts/kconfig/Makefile also searches kernel/configs/*.config
for fragments. This behaviour should also be in merge_into_defconfig.

Changed in v2:
  - Split changes to two patches

Zhang Bingwu (2):
  kbuild: defconf: use SRCARCH to find merged configs
  kbuild: find kernel/configs/ for merged fragments

 scripts/Makefile.defconf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.43.0


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

* [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs
  2024-01-14  8:13 ` [PATCH v2 0/2] kbuild: find kernel/configs for merged fragments Zhang Bingwu
@ 2024-01-14  8:13   ` Zhang Bingwu
  2024-01-16 11:28     ` Masahiro Yamada
  2024-01-14  8:14   ` [PATCH v2 2/2] kbuild: find kernel/configs/ for merged fragments Zhang Bingwu
  1 sibling, 1 reply; 7+ messages in thread
From: Zhang Bingwu @ 2024-01-14  8:13 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nick Desaulniers,
	Nicolas Schier, linux-kbuild, linux-kernel
  Cc: Zhang Bingwu

From: Zhang Bingwu <xtexchooser@duck.com>

For some ARCH values, SRCARCH, which should be used for finding arch/
subdirectory, is different from ARCH.

Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>
---
 scripts/Makefile.defconf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.defconf b/scripts/Makefile.defconf
index ab271b205..226ea3df3 100644
--- a/scripts/Makefile.defconf
+++ b/scripts/Makefile.defconf
@@ -9,8 +9,8 @@
 # Input config fragments without '.config' suffix
 define merge_into_defconfig
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-		-m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
-		$(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
+		-m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
+		$(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
 
@@ -23,7 +23,7 @@ endef
 # Input config fragments without '.config' suffix
 define merge_into_defconfig_override
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-		-Q -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
-		$(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
+		-Q -m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
+		$(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
-- 
2.43.0


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

* [PATCH v2 2/2] kbuild: find kernel/configs/ for merged fragments
  2024-01-14  8:13 ` [PATCH v2 0/2] kbuild: find kernel/configs for merged fragments Zhang Bingwu
  2024-01-14  8:13   ` [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs Zhang Bingwu
@ 2024-01-14  8:14   ` Zhang Bingwu
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang Bingwu @ 2024-01-14  8:14 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nick Desaulniers,
	Nicolas Schier, linux-kbuild, linux-kernel
  Cc: Zhang Bingwu

From: Zhang Bingwu <xtexchooser@duck.com>

kernel/configs consists of several arch-independent config fragments,
which should also be searched for by merge_into_defconfig.

When using 'make xxx_defconfig xxx.config' to merge fragments,
scripts/kconfig/Makefile also searches kernel/configs/*.config
for fragments. This behaviour should also be in merge_into_defconfig.

Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>
---
 scripts/Makefile.defconf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.defconf b/scripts/Makefile.defconf
index 226ea3df3..777be9bf7 100644
--- a/scripts/Makefile.defconf
+++ b/scripts/Makefile.defconf
@@ -10,7 +10,7 @@
 define merge_into_defconfig
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
 		-m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
-		$(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
+		$(foreach config,$(2),$(wildcard $(srctree)/kernel/configs/$(config).config $(srctree)/arch/$(SRCARCH)/configs/$(config).config))
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
 
@@ -24,6 +24,6 @@ endef
 define merge_into_defconfig_override
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
 		-Q -m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
-		$(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
+		$(foreach config,$(2),$(wildcard $(srctree)/kernel/configs/$(config).config $(srctree)/arch/$(SRCARCH)/configs/$(config).config))
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
-- 
2.43.0


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

* Re: [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs
  2024-01-14  8:13   ` [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs Zhang Bingwu
@ 2024-01-16 11:28     ` Masahiro Yamada
  2024-01-27 16:13       ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2024-01-16 11:28 UTC (permalink / raw)
  To: Zhang Bingwu
  Cc: Nathan Chancellor, Nick Desaulniers, Nicolas Schier, linux-kbuild,
	linux-kernel, Zhang Bingwu, Arnd Bergmann

On Sun, Jan 14, 2024 at 5:14 PM Zhang Bingwu <xtex@envs.net> wrote:
>
> From: Zhang Bingwu <xtexchooser@duck.com>
>
> For some ARCH values, SRCARCH, which should be used for finding arch/
> subdirectory, is different from ARCH.
>
> Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>



As you can see in "git log scripts/Makefile.defconf",
I was not involved in anything about this file.

I do not see much interest in this patch set, but
Arnd Bergmann might be excited about it.

(You did not accompany with a real use case though)









> ---
>  scripts/Makefile.defconf | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/Makefile.defconf b/scripts/Makefile.defconf
> index ab271b205..226ea3df3 100644
> --- a/scripts/Makefile.defconf
> +++ b/scripts/Makefile.defconf
> @@ -9,8 +9,8 @@
>  # Input config fragments without '.config' suffix
>  define merge_into_defconfig
>         $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
> -               -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
> -               $(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
> +               -m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
> +               $(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
>         +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
>  endef
>
> @@ -23,7 +23,7 @@ endef
>  # Input config fragments without '.config' suffix
>  define merge_into_defconfig_override
>         $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
> -               -Q -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
> -               $(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
> +               -Q -m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
> +               $(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
>         +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
>  endef
> --
> 2.43.0
>
>


--
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs
  2024-01-16 11:28     ` Masahiro Yamada
@ 2024-01-27 16:13       ` Masahiro Yamada
  0 siblings, 0 replies; 7+ messages in thread
From: Masahiro Yamada @ 2024-01-27 16:13 UTC (permalink / raw)
  To: Zhang Bingwu
  Cc: Nathan Chancellor, Nick Desaulniers, Nicolas Schier, linux-kbuild,
	linux-kernel, Zhang Bingwu, Arnd Bergmann

On Tue, Jan 16, 2024 at 8:28 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Sun, Jan 14, 2024 at 5:14 PM Zhang Bingwu <xtex@envs.net> wrote:
> >
> > From: Zhang Bingwu <xtexchooser@duck.com>
> >
> > For some ARCH values, SRCARCH, which should be used for finding arch/
> > subdirectory, is different from ARCH.
> >
> > Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>
>
>
>
> As you can see in "git log scripts/Makefile.defconf",
> I was not involved in anything about this file.
>
> I do not see much interest in this patch set, but
> Arnd Bergmann might be excited about it.
>
> (You did not accompany with a real use case though)




Having said that, 1/2 is a bug fix.

I applied this to linux-kbuild/fixes. Thanks.




-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2024-01-27 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-13  0:11 [PATCH 0/1] kbuild: find kernel/configs for fragments in fragment merging Zhang Bingwu
2024-01-13  0:11 ` [PATCH 1/1] " Zhang Bingwu
2024-01-14  8:13 ` [PATCH v2 0/2] kbuild: find kernel/configs for merged fragments Zhang Bingwu
2024-01-14  8:13   ` [PATCH v2 1/2] kbuild: defconf: use SRCARCH to find merged configs Zhang Bingwu
2024-01-16 11:28     ` Masahiro Yamada
2024-01-27 16:13       ` Masahiro Yamada
2024-01-14  8:14   ` [PATCH v2 2/2] kbuild: find kernel/configs/ for merged fragments Zhang Bingwu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox