From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA5652773CA for ; Sat, 6 Dec 2025 16:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765040314; cv=none; b=lAiRsONfeL2RYoRCJQ2y5nm79yba0vlw/4V3TwWCrq6Y9CKXOS6FVmZhFzLXGz1XlM48I69fxpYHfIhAax4vUIQL847RANtAfaOtHaGJYy+f56OfR/2HpA1MLI+fadll9MKf8XHbhzhIFG1jJ0VEbuiWkKZiNQIVw2tTM6xORLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765040314; c=relaxed/simple; bh=NqvtqRpkw7t8YvhjxAKdtXXuBOCHiSGVcPJu904BzB4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TxlZImeX8IZwuWJVJ65YLq6swOH2y93axv+cJeD/Q1rwnwrVNWGHJj2S7/UxcmJmZf1tOaVboT3zXBh5yFyboA93wiMfAWHTLXDnrQT6UQjYJbmz34mLqPlHdBUUQK605el3ePQywkHedKyUf487i1N6UXcFvZb4E6+tsClKK2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=geOIM+z8; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="geOIM+z8" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=CZ/Mitf3+vAwfVg1NxOfdRguv+OHAYJYxJcvs7zT53g=; b=geOIM+z8cryW4+FokuwN6oe/EV faG+Riyi8WHEyhXf9S/pxoSr8NZgsWHSLUtvv/C+VjbYVgcZicmIzb5Ds/tlxt1mGG3mg2FbSYTMK eGzY9F7XrPznlGFoXgfA3XuycXohL/e2GspU9OWlWSlsO/YmTVVELSWDnCPVsSqEe8qX8KSvAU4KD uEopJwHnkJav20dUVL3gLKucAsAUoQHltzzQcVvVNKKGxmAd6ITb5LU18kd+o1KViXGJ/Qp102azv TRuMi+Cfhw3IO+DS1XNNWgtaR5JsySaCzdo9UGSZSlk8/p1XMBPomC+6Z0cnp6ClE/LDvfPYl3R6f ASsPsx5Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vRvc8-0000000B4tD-2MhA; Sat, 06 Dec 2025 16:58:32 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 5/8] kconfig: Add support for merging defconfig fragments Date: Sat, 6 Dec 2025 08:56:19 -0800 Message-ID: <20251206165624.2640158-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251206165624.2640158-1-mcgrof@kernel.org> References: <20251206165624.2640158-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain 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 --- 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-+ +# Example: make defconfig-datacrunch-b200-or-less+myworkflow +# +# The fragment is looked up in defconfigs/configs/.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