From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
"Claude Opus 4.6" <noreply@anthropic.com>
Subject: [PATCH 1/2] kconfig: add merge_into_defconfig_named to set CONFIG_NAME
Date: Mon, 16 Feb 2026 09:39:01 +0100 [thread overview]
Message-ID: <20260216083907.3543595-1-a.fatoum@pengutronix.de> (raw)
Generated defconfigs that merge fragments into a base config inherit
CONFIG_NAME from the base, which is wrong for testing: pytest uses
CONFIG_NAME to locate the matching Labgrid environment YAML.
Add merge_into_defconfig_named, which appends the correct CONFIG_NAME
to .config before running olddefconfig, and switch all callers over.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Makefile | 4 ++--
arch/arm/Makefile | 4 ++--
arch/mips/Makefile | 6 +++---
arch/riscv/Makefile | 4 ++--
arch/sandbox/Makefile | 10 +++++-----
scripts/Makefile.defconf | 13 +++++++++++++
6 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index 4296c97ef02d..7f31e79439fd 100644
--- a/Makefile
+++ b/Makefile
@@ -618,9 +618,9 @@ export KBUILD_DEFCONFIG CC_VERSION_TEXT
endif
%_efiloader_defconfig: FORCE
- $(call merge_into_defconfig,$*_defconfig,efi-loader)
+ $(call merge_into_defconfig_named,$*_defconfig,efi-loader,$@)
%_efi_defconfig: FORCE
- $(call merge_into_defconfig,$*_defconfig,efi-loader efi-payload)
+ $(call merge_into_defconfig_named,$*_defconfig,efi-loader efi-payload,$@)
config: outputmakefile scripts_basic FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig KCONFIG_DEFCONFIG_LIST= $@
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index b38f694339a4..3455b2a79f75 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -4,9 +4,9 @@ KBUILD_DEFCONFIG := multi_v8_defconfig
generated_configs += am335x_mlo_sdmmc_defconfig am335x_mlo_rawflash_defconfig
am335x_mlo_sdmmc_defconfig:
- $(call merge_into_defconfig,am335x_mlo_defconfig,nomtd)
+ $(call merge_into_defconfig_named,am335x_mlo_defconfig,nomtd,$@)
am335x_mlo_rawflash_defconfig:
- $(call merge_into_defconfig,am335x_mlo_defconfig,nomci)
+ $(call merge_into_defconfig_named,am335x_mlo_defconfig,nomci,$@)
# Generic rule applying the fragment is in top-level Makefile
generated_configs += $(patsubst %_defconfig,%_efiloader_defconfig, \
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 67d355e0ad81..8001bb54bed5 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -4,11 +4,11 @@ KBUILD_DEFCONFIG := qemu-malta_defconfig
generated_configs += $(patsubst %, qemu-malta%_defconfig, el 64 64el)
qemu-maltael_defconfig:
- $(call merge_into_defconfig,qemu-malta_defconfig,le)
+ $(call merge_into_defconfig_named,qemu-malta_defconfig,le,$@)
qemu-malta64_defconfig:
- $(call merge_into_defconfig,qemu-malta_defconfig,mips64)
+ $(call merge_into_defconfig_named,qemu-malta_defconfig,mips64,$@)
qemu-malta64el_defconfig:
- $(call merge_into_defconfig,qemu-malta_defconfig,mips64 le)
+ $(call merge_into_defconfig_named,qemu-malta_defconfig,mips64 le,$@)
#
# Select the object file format to substitute into the linker script.
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index c7682d4bd003..d22a0368a33c 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -5,9 +5,9 @@ KBUILD_DEFCONFIG := rv64i_defconfig
generated_configs += virt32_mmu_defconfig rv64i_mmu_defconfig
virt32_mmu_defconfig:
- $(call merge_into_defconfig,virt32_defconfig,enable_mmu)
+ $(call merge_into_defconfig_named,virt32_defconfig,enable_mmu,$@)
rv64i_mmu_defconfig:
- $(call merge_into_defconfig,rv64i_defconfig,enable_mmu)
+ $(call merge_into_defconfig_named,rv64i_defconfig,enable_mmu,$@)
KBUILD_CPPFLAGS += -fno-strict-aliasing
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 1b1774cc4b0a..27c3a591e2d9 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -5,15 +5,15 @@ KBUILD_DEFCONFIG := sandbox_defconfig
generated_configs += headless_defconfig noshell_defconfig lockdown_defconfig \
simpleconsole_defconfig libfuzzer_defconfig
headless_defconfig:
- $(call merge_into_defconfig,sandbox_defconfig,headless)
+ $(call merge_into_defconfig_named,sandbox_defconfig,headless,$@)
noshell_defconfig:
- $(call merge_into_defconfig,sandbox_defconfig,noshell)
+ $(call merge_into_defconfig_named,sandbox_defconfig,noshell,$@)
lockdown_defconfig:
- $(call merge_into_defconfig,sandbox_defconfig,headless noshell)
+ $(call merge_into_defconfig_named,sandbox_defconfig,headless noshell,$@)
simpleconsole_defconfig:
- $(call merge_into_defconfig,sandbox_defconfig,simpleconsole)
+ $(call merge_into_defconfig_named,sandbox_defconfig,simpleconsole,$@)
libfuzzer_defconfig:
- $(call merge_into_defconfig,sandbox_defconfig,libfuzzer)
+ $(call merge_into_defconfig_named,sandbox_defconfig,libfuzzer,$@)
KBUILD_CPPFLAGS += -D__SANDBOX__ -fno-strict-aliasing -fvisibility=hidden
diff --git a/scripts/Makefile.defconf b/scripts/Makefile.defconf
index 93c848bb5a12..75a39cf333a5 100644
--- a/scripts/Makefile.defconf
+++ b/scripts/Makefile.defconf
@@ -35,3 +35,16 @@ define merge_into_defconfig_override
))
+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
endef
+
+
+# Creates 'merged defconfigs' and sets CONFIG_NAME to the config name
+# ---------------------------------------------------------------------------
+# Usage:
+# $(call merge_into_defconfig_named,base_config,config_fragment1 config_fragment2 ...,config_name)
+#
+# Input config fragments without '.config' suffix
+define merge_into_defconfig_named
+ $(call merge_into_defconfig_override,$1,$2)
+ $(Q)echo 'CONFIG_NAME="$3"' >> $(objtree)/.config
+ +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
+endef
--
2.47.3
next reply other threads:[~2026-02-16 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 8:39 Ahmad Fatoum [this message]
2026-02-16 8:39 ` [PATCH 2/2] test: report used Labgrid environment and build dir Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260216083907.3543595-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox