From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 5/8] kconfig: Add support for merging defconfig fragments
Date: Sat, 6 Dec 2025 08:56:19 -0800 [thread overview]
Message-ID: <20251206165624.2640158-6-mcgrof@kernel.org> (raw)
In-Reply-To: <20251206165624.2640158-1-mcgrof@kernel.org>
Add support for composing defconfigs from base configurations and
fragments using the + syntax. This allows users to combine a base
defconfig with additional config fragments stored in defconfigs/configs/.
The merge_config.sh script from the kernel is used to combine the
configurations. Multiple fragments can be chained together.
Example usage:
make defconfig-datacrunch-b200-or-less+myworkflow
make defconfig-aws+fstests+debug
This enables modular configuration management where common settings
can be shared across different base configurations.
Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
scripts/kconfig/kconfig.Makefile | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/scripts/kconfig/kconfig.Makefile b/scripts/kconfig/kconfig.Makefile
index 5d6db4b8..0113ffd3 100644
--- a/scripts/kconfig/kconfig.Makefile
+++ b/scripts/kconfig/kconfig.Makefile
@@ -57,7 +57,25 @@ PHONY += $(simple-targets)
$(simple-targets): $(KCONFIG_DIR)/conf Kconfig
$< --$@ Kconfig
+# Support merging config fragments with base defconfigs
+# Usage: make defconfig-<base>+<fragment>
+# Example: make defconfig-datacrunch-b200-or-less+myworkflow
+#
+# The fragment is looked up in defconfigs/configs/<fragment>.config
+# Multiple fragments can be chained: make defconfig-base+frag1+frag2
defconfig-%:: $(KCONFIG_DIR)/conf include/config/project.release Kconfig
- @$< --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig
+ @STEM="$(@:defconfig-%=%)"; \
+ if echo "$$STEM" | grep -q '+'; then \
+ BASE=$$(echo "$$STEM" | cut -d'+' -f1); \
+ FRAGS=$$(echo "$$STEM" | cut -d'+' -f2- | tr '+' ' '); \
+ FRAG_FILES=""; \
+ for f in $$FRAGS; do \
+ FRAG_FILES="$$FRAG_FILES defconfigs/configs/$$f.config"; \
+ done; \
+ $(KCONFIG_DIR)/merge_config.sh -m -Q defconfigs/$$BASE $$FRAG_FILES && \
+ $< --defconfig=.config Kconfig; \
+ else \
+ $< --defconfig=defconfigs/$$STEM Kconfig; \
+ fi
.PHONY: $(PHONY)
--
2.51.0
next prev parent reply other threads:[~2025-12-06 16:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 16:56 [PATCH 0/8] neoclouds: add new datacrunch / verda support Luis Chamberlain
2025-12-06 16:56 ` [PATCH 1/8] terraform: Use directory checksum in SSH key filenames Luis Chamberlain
2025-12-06 22:28 ` Chuck Lever
2025-12-12 19:14 ` Chuck Lever
2025-12-15 15:41 ` Chuck Lever
2025-12-06 16:56 ` [PATCH 2/8] devconfig: Add tmux.conf copying to target systems Luis Chamberlain
2025-12-06 16:56 ` [PATCH 3/8] terraform: Enable fact gathering for localhost Luis Chamberlain
2025-12-07 16:23 ` Chuck Lever
2025-12-06 16:56 ` [PATCH 4/8] terraform: Add DataCrunch GPU cloud provider integration Luis Chamberlain
2025-12-16 16:12 ` Chuck Lever
2025-12-06 16:56 ` Luis Chamberlain [this message]
2025-12-07 16:25 ` [PATCH 5/8] kconfig: Add support for merging defconfig fragments Chuck Lever
2025-12-07 20:37 ` Daniel Gomez
2025-12-06 16:56 ` [PATCH 6/8] terraform: Add tier-based GPU selection for Lambda Labs Luis Chamberlain
2025-12-16 18:05 ` Chuck Lever
2025-12-06 16:56 ` [PATCH 7/8] terraform: Document " Luis Chamberlain
2025-12-16 19:30 ` Chuck Lever
2025-12-06 16:56 ` [PATCH 8/8] docs: Organize cloud providers with Neoclouds section Luis Chamberlain
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=20251206165624.2640158-6-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
/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