[v2,2/2] kbuild: find kernel/configs/ for merged fragments

Message ID 20240114081400.12452-3-xtex@envs.net
State New
Headers
Series kbuild: find kernel/configs for merged fragments |

Commit Message

xtex Jan. 14, 2024, 8:14 a.m. UTC
  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(-)
  

Patch

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