diff mbox series

[1/1] kbuild: find kernel/configs for fragments in fragment merging

Message ID 20240113001135.7781-2-xtex@envs.net (mailing list archive)
State New, archived
Headers show
Series kbuild: find kernel/configs for fragments in fragment merging | expand

Commit Message

Bingwu Zhang Jan. 13, 2024, 12:11 a.m. UTC
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 mbox series

Patch

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