lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251128-kbuild-add-top-level-target-for-building-gen_init_cpio-v1-1-84c63a8fc8d4@kernel.org>
Date: Fri, 28 Nov 2025 21:01:55 +0100
From: Nicolas Schier <nsc@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>, 
 Nicolas Schier <nicolas.schier@...ux.dev>
Cc: Ahmad Fatoum <a.fatoum@...gutronix.de>, 
 Sascha Hauer <s.hauer@...gutronix.de>, Simon Glass <sjg@...omium.org>, 
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>, 
 linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Nicolas Schier <nsc@...nel.org>
Subject: [PATCH] kbuild: Add top-level target for building gen_init_cpio

Add a top-level target for building gen_init_cpio to prevent re-entering
kbuild for 'modules-cpio-pkg'.

The recently introduced target 'modules-cpio-pkg' depends on
gen_init_cpio but there is no simple way to add this dependency as a
prerequisite that can be built in parallel to other recipes.

Introducing the top-level target, enables fixing this and also prepares
a possible move of gen_init_cpio from usr/ to scripts/.

Signed-off-by: Nicolas Schier <nsc@...nel.org>
---
This is based on the patch set from
https://lore.kernel.org/linux-kbuild/20251125-cpio-modules-pkg-v2-0-aa8277d89682@pengutronix.de
---
 Makefile                 | 6 ++++++
 scripts/Makefile.package | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 17cfa11ca716..d5750e5bd633 100644
--- a/Makefile
+++ b/Makefile
@@ -1383,6 +1383,10 @@ ifdef CONFIG_HEADERS_INSTALL
 prepare: headers
 endif
 
+PHONY += usr_gen_init_cpio
+usr_gen_init_cpio: scripts_basic
+	$(Q)$(MAKE) $(build)=usr usr/gen_init_cpio
+
 PHONY += scripts_unifdef
 scripts_unifdef: scripts_basic
 	$(Q)$(MAKE) $(build)=scripts scripts/unifdef
@@ -1635,6 +1639,8 @@ distclean: mrproper
 # Packaging of the kernel to various formats
 # ---------------------------------------------------------------------------
 
+modules-cpio-pkg: usr_gen_init_cpio
+
 %src-pkg: FORCE
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
 %pkg: include/config/kernel.release FORCE
diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 83bfcf7cb09f..0ec946f9b905 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -201,7 +201,6 @@ quiet_cmd_cpio = CPIO    $@
       cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $<
 
 modules-$(KERNELRELEASE)-$(ARCH).cpio: .tmp_modules_cpio
-	$(Q)$(MAKE) $(build)=usr usr/gen_init_cpio
 	$(call cmd,cpio)
 
 PHONY += modules-cpio-pkg

---
base-commit: cb6649f6217c0331b885cf787f1d175963e2a1d2
change-id: 20251128-kbuild-add-top-level-target-for-building-gen_init_cpio-6401e0ee0710
prerequisite-message-id: 20251125-cpio-modules-pkg-v2-0-aa8277d89682@...gutronix.de
prerequisite-patch-id: 9132e567c46357daaf2bd728ff18bfda1c51a9cb
prerequisite-patch-id: 0dfe03db654169d314d3baaba8536a9bfc9bcc70

Best regards,
-- 
Nicolas


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ