linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-s390@vger.kernel.org, Randy Dunlap <rdunlap@infradead.org>,
	Kees Cook <keescook@chromium.org>,
	linux-kbuild@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
	linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	Nicolas Schier <nicolas@fjasle.eu>
Subject: [PATCH v2 2/2] kbuild: Split internal config targets from .config into .fragment
Date: Fri, 25 Aug 2023 12:47:53 -0700	[thread overview]
Message-ID: <20230825194755.854823-2-keescook@chromium.org> (raw)
In-Reply-To: <20230825194329.gonna.911-kees@kernel.org>

Many Kconfig fragments are being used internally to construct hard-coded
targets and shouldn't be reachable directly through the build system.
Splitting these out also means that the "help" target can display only
the "complete" .config targets intended for general use. This is
especially useful for powerpc where most of the arch fragments aren't
intended to be consumed individually.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: x86@kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-kbuild@vger.kernel.org
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/powerpc/Makefile                         | 26 +++++++++----------
 .../{32-bit.config => 32-bit.fragment}        |  0
 .../{64-bit.config => 64-bit.fragment}        |  0
 ...{85xx-32bit.config => 85xx-32bit.fragment} |  0
 ...{85xx-64bit.config => 85xx-64bit.fragment} |  0
 .../{85xx-hw.config => 85xx-hw.fragment}      |  0
 .../{85xx-smp.config => 85xx-smp.fragment}    |  0
 .../{86xx-hw.config => 86xx-hw.fragment}      |  0
 .../{86xx-smp.config => 86xx-smp.fragment}    |  0
 .../{altivec.config => altivec.fragment}      |  0
 .../configs/{be.config => be.fragment}        |  0
 .../{book3s_32.config => book3s_32.fragment}  |  0
 ...enet_base.config => corenet_base.fragment} |  0
 .../configs/{dpaa.config => dpaa.fragment}    |  0
 ...mb-nonhw.config => fsl-emb-nonhw.fragment} |  0
 .../configs/{guest.config => guest.fragment}  |  0
 .../configs/{le.config => le.fragment}        |  0
 ...85xx_base.config => mpc85xx_base.fragment} |  0
 ...86xx_base.config => mpc86xx_base.fragment} |  0
 .../{ppc64le.config => ppc64le.fragment}      |  0
 {kernel => arch/x86}/configs/x86_debug.config |  0
 .../{tiny-base.config => tiny-base.fragment}  |  0
 scripts/Makefile.defconf                      | 12 ++++++---
 scripts/kconfig/Makefile                      |  2 +-
 24 files changed, 22 insertions(+), 18 deletions(-)
 rename arch/powerpc/configs/{32-bit.config => 32-bit.fragment} (100%)
 rename arch/powerpc/configs/{64-bit.config => 64-bit.fragment} (100%)
 rename arch/powerpc/configs/{85xx-32bit.config => 85xx-32bit.fragment} (100%)
 rename arch/powerpc/configs/{85xx-64bit.config => 85xx-64bit.fragment} (100%)
 rename arch/powerpc/configs/{85xx-hw.config => 85xx-hw.fragment} (100%)
 rename arch/powerpc/configs/{85xx-smp.config => 85xx-smp.fragment} (100%)
 rename arch/powerpc/configs/{86xx-hw.config => 86xx-hw.fragment} (100%)
 rename arch/powerpc/configs/{86xx-smp.config => 86xx-smp.fragment} (100%)
 rename arch/powerpc/configs/{altivec.config => altivec.fragment} (100%)
 rename arch/powerpc/configs/{be.config => be.fragment} (100%)
 rename arch/powerpc/configs/{book3s_32.config => book3s_32.fragment} (100%)
 rename arch/powerpc/configs/{corenet_base.config => corenet_base.fragment} (100%)
 rename arch/powerpc/configs/{dpaa.config => dpaa.fragment} (100%)
 rename arch/powerpc/configs/{fsl-emb-nonhw.config => fsl-emb-nonhw.fragment} (100%)
 rename arch/powerpc/configs/{guest.config => guest.fragment} (100%)
 rename arch/powerpc/configs/{le.config => le.fragment} (100%)
 rename arch/powerpc/configs/{mpc85xx_base.config => mpc85xx_base.fragment} (100%)
 rename arch/powerpc/configs/{mpc86xx_base.config => mpc86xx_base.fragment} (100%)
 rename arch/powerpc/configs/{ppc64le.config => ppc64le.fragment} (100%)
 rename {kernel => arch/x86}/configs/x86_debug.config (100%)
 rename kernel/configs/{tiny-base.config => tiny-base.fragment} (100%)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index dac7ca153886..b73f2b40a0bc 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -267,66 +267,66 @@ powernv_be_defconfig:
 
 generated_configs += mpc85xx_defconfig
 mpc85xx_defconfig:
-	$(call merge_into_defconfig,mpc85xx_base.config,\
+	$(call merge_into_defconfig,mpc85xx_base.fragment,\
 		85xx-32bit 85xx-hw fsl-emb-nonhw)
 
 generated_configs += mpc85xx_smp_defconfig
 mpc85xx_smp_defconfig:
-	$(call merge_into_defconfig,mpc85xx_base.config,\
+	$(call merge_into_defconfig,mpc85xx_base.fragment,\
 		85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw)
 
 generated_configs += corenet32_smp_defconfig
 corenet32_smp_defconfig:
-	$(call merge_into_defconfig,corenet_base.config,\
+	$(call merge_into_defconfig,corenet_base.fragment,\
 		85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw dpaa)
 
 generated_configs += corenet64_smp_defconfig
 corenet64_smp_defconfig:
-	$(call merge_into_defconfig,corenet_base.config,\
+	$(call merge_into_defconfig,corenet_base.fragment,\
 		85xx-64bit 85xx-smp altivec 85xx-hw fsl-emb-nonhw dpaa)
 
 generated_configs += mpc86xx_defconfig
 mpc86xx_defconfig:
-	$(call merge_into_defconfig,mpc86xx_base.config,\
+	$(call merge_into_defconfig,mpc86xx_base.fragment,\
 		86xx-hw fsl-emb-nonhw)
 
 generated_configs += mpc86xx_smp_defconfig
 mpc86xx_smp_defconfig:
-	$(call merge_into_defconfig,mpc86xx_base.config,\
+	$(call merge_into_defconfig,mpc86xx_base.fragment,\
 		86xx-smp 86xx-hw fsl-emb-nonhw)
 
 generated_configs += ppc32_allmodconfig
 ppc32_allmodconfig:
-	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \
+	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.fragment \
 		-f $(srctree)/Makefile allmodconfig
 
 generated_configs += ppc_defconfig
 ppc_defconfig:
-	$(call merge_into_defconfig,book3s_32.config,)
+	$(call merge_into_defconfig,book3s_32.fragment,)
 
 generated_configs += ppc64le_allmodconfig
 ppc64le_allmodconfig:
-	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \
+	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.fragment \
 		-f $(srctree)/Makefile allmodconfig
 
 generated_configs += ppc64le_allnoconfig
 ppc64le_allnoconfig:
-	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/ppc64le.config \
+	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/ppc64le.fragment \
 		-f $(srctree)/Makefile allnoconfig
 
 generated_configs += ppc64_book3e_allmodconfig
 ppc64_book3e_allmodconfig:
-	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/85xx-64bit.config \
+	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/85xx-64bit.fragment \
 		-f $(srctree)/Makefile allmodconfig
 
 generated_configs += ppc32_randconfig
 ppc32_randconfig:
-	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/32-bit.config \
+	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/32-bit.fragment \
 		-f $(srctree)/Makefile randconfig
 
 generated_configs += ppc64_randconfig
 ppc64_randconfig:
-	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/64-bit.config \
+	$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/64-bit.fragment \
 		-f $(srctree)/Makefile randconfig
 
 PHONY += $(generated_configs)
diff --git a/arch/powerpc/configs/32-bit.config b/arch/powerpc/configs/32-bit.fragment
similarity index 100%
rename from arch/powerpc/configs/32-bit.config
rename to arch/powerpc/configs/32-bit.fragment
diff --git a/arch/powerpc/configs/64-bit.config b/arch/powerpc/configs/64-bit.fragment
similarity index 100%
rename from arch/powerpc/configs/64-bit.config
rename to arch/powerpc/configs/64-bit.fragment
diff --git a/arch/powerpc/configs/85xx-32bit.config b/arch/powerpc/configs/85xx-32bit.fragment
similarity index 100%
rename from arch/powerpc/configs/85xx-32bit.config
rename to arch/powerpc/configs/85xx-32bit.fragment
diff --git a/arch/powerpc/configs/85xx-64bit.config b/arch/powerpc/configs/85xx-64bit.fragment
similarity index 100%
rename from arch/powerpc/configs/85xx-64bit.config
rename to arch/powerpc/configs/85xx-64bit.fragment
diff --git a/arch/powerpc/configs/85xx-hw.config b/arch/powerpc/configs/85xx-hw.fragment
similarity index 100%
rename from arch/powerpc/configs/85xx-hw.config
rename to arch/powerpc/configs/85xx-hw.fragment
diff --git a/arch/powerpc/configs/85xx-smp.config b/arch/powerpc/configs/85xx-smp.fragment
similarity index 100%
rename from arch/powerpc/configs/85xx-smp.config
rename to arch/powerpc/configs/85xx-smp.fragment
diff --git a/arch/powerpc/configs/86xx-hw.config b/arch/powerpc/configs/86xx-hw.fragment
similarity index 100%
rename from arch/powerpc/configs/86xx-hw.config
rename to arch/powerpc/configs/86xx-hw.fragment
diff --git a/arch/powerpc/configs/86xx-smp.config b/arch/powerpc/configs/86xx-smp.fragment
similarity index 100%
rename from arch/powerpc/configs/86xx-smp.config
rename to arch/powerpc/configs/86xx-smp.fragment
diff --git a/arch/powerpc/configs/altivec.config b/arch/powerpc/configs/altivec.fragment
similarity index 100%
rename from arch/powerpc/configs/altivec.config
rename to arch/powerpc/configs/altivec.fragment
diff --git a/arch/powerpc/configs/be.config b/arch/powerpc/configs/be.fragment
similarity index 100%
rename from arch/powerpc/configs/be.config
rename to arch/powerpc/configs/be.fragment
diff --git a/arch/powerpc/configs/book3s_32.config b/arch/powerpc/configs/book3s_32.fragment
similarity index 100%
rename from arch/powerpc/configs/book3s_32.config
rename to arch/powerpc/configs/book3s_32.fragment
diff --git a/arch/powerpc/configs/corenet_base.config b/arch/powerpc/configs/corenet_base.fragment
similarity index 100%
rename from arch/powerpc/configs/corenet_base.config
rename to arch/powerpc/configs/corenet_base.fragment
diff --git a/arch/powerpc/configs/dpaa.config b/arch/powerpc/configs/dpaa.fragment
similarity index 100%
rename from arch/powerpc/configs/dpaa.config
rename to arch/powerpc/configs/dpaa.fragment
diff --git a/arch/powerpc/configs/fsl-emb-nonhw.config b/arch/powerpc/configs/fsl-emb-nonhw.fragment
similarity index 100%
rename from arch/powerpc/configs/fsl-emb-nonhw.config
rename to arch/powerpc/configs/fsl-emb-nonhw.fragment
diff --git a/arch/powerpc/configs/guest.config b/arch/powerpc/configs/guest.fragment
similarity index 100%
rename from arch/powerpc/configs/guest.config
rename to arch/powerpc/configs/guest.fragment
diff --git a/arch/powerpc/configs/le.config b/arch/powerpc/configs/le.fragment
similarity index 100%
rename from arch/powerpc/configs/le.config
rename to arch/powerpc/configs/le.fragment
diff --git a/arch/powerpc/configs/mpc85xx_base.config b/arch/powerpc/configs/mpc85xx_base.fragment
similarity index 100%
rename from arch/powerpc/configs/mpc85xx_base.config
rename to arch/powerpc/configs/mpc85xx_base.fragment
diff --git a/arch/powerpc/configs/mpc86xx_base.config b/arch/powerpc/configs/mpc86xx_base.fragment
similarity index 100%
rename from arch/powerpc/configs/mpc86xx_base.config
rename to arch/powerpc/configs/mpc86xx_base.fragment
diff --git a/arch/powerpc/configs/ppc64le.config b/arch/powerpc/configs/ppc64le.fragment
similarity index 100%
rename from arch/powerpc/configs/ppc64le.config
rename to arch/powerpc/configs/ppc64le.fragment
diff --git a/kernel/configs/x86_debug.config b/arch/x86/configs/x86_debug.config
similarity index 100%
rename from kernel/configs/x86_debug.config
rename to arch/x86/configs/x86_debug.config
diff --git a/kernel/configs/tiny-base.config b/kernel/configs/tiny-base.fragment
similarity index 100%
rename from kernel/configs/tiny-base.config
rename to kernel/configs/tiny-base.fragment
diff --git a/scripts/Makefile.defconf b/scripts/Makefile.defconf
index ab271b2051a2..46d0ecdda391 100644
--- a/scripts/Makefile.defconf
+++ b/scripts/Makefile.defconf
@@ -6,11 +6,13 @@
 # Usage:
 #   $(call merge_into_defconfig,base_config,config_fragment1 config_fragment2 ...)
 #
-# Input config fragments without '.config' suffix
+# Input config fragments without '.config' or '.fragment' suffix
 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)/arch/$(ARCH)/configs/$(config).config \
+				   $(srctree)/arch/$(ARCH)/configs/$(config).fragment))
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
 
@@ -20,10 +22,12 @@ endef
 # Usage:
 #   $(call merge_into_defconfig_override,base_config,config_fragment1 config_fragment2 ...)
 #
-# Input config fragments without '.config' suffix
+# Input config fragments without '.config' or '.fragment' suffix
 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)/arch/$(ARCH)/configs/$(config).config \
+				   $(srctree)/arch/$(ARCH)/configs/$(config).fragment))
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 endef
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 370ff6bba78d..a03388eb735f 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -102,7 +102,7 @@ configfiles=$(wildcard $(srctree)/kernel/configs/$(1) $(srctree)/arch/$(SRCARCH)
 
 PHONY += tinyconfig
 tinyconfig:
-	$(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f $(srctree)/Makefile allnoconfig
+	$(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.fragment $(MAKE) -f $(srctree)/Makefile allnoconfig
 	$(Q)$(MAKE) -f $(srctree)/Makefile tiny.config
 
 # CHECK: -o cache_dir=<path> working?
-- 
2.34.1


  parent reply	other threads:[~2023-08-25 19:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 19:47 [PATCH v2 0/2] kbuild: Show Kconfig fragments in "help" Kees Cook
2023-08-25 19:47 ` [PATCH v2 1/2] " Kees Cook
2023-08-25 19:47 ` Kees Cook [this message]
2023-08-28  1:03 ` [PATCH v2 0/2] " Masahiro Yamada
2023-08-28  6:17   ` Michael Ellerman
2023-08-29  6:16     ` Nicolas Schier
2023-08-29 14:57       ` Masahiro Yamada
2023-08-29 20:07         ` Nicolas Schier
2023-08-31  0:03         ` Kees Cook
2023-08-31 15:45           ` Masahiro Yamada

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=20230825194755.854823-2-keescook@chromium.org \
    --to=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=masahiroy@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=rdunlap@infradead.org \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).