From nobody Tue Dec 2 00:02:24 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 EA9DF21D58B for ; Tue, 25 Nov 2025 13:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764076723; cv=none; b=VNX1/WsV6085JAkcvDtv80IBpq50y7A1hrPsTeHuonPZ2al6WY+edjrKuC/CO16NZueGomv591qUc785bNGg02M2TR95ec0Hh8Jn50H9dEcjjzLq+ToqOdiniHYfTyyi/r4c/HSudSvqwWHX4xpFJ7qJl3Z5HbcnNnYG2aC1cEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764076723; c=relaxed/simple; bh=icIRvzjKSFAtU7+vHUdJjpXmUbPgNbo4d8PtONv30/4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EpY/HngUuPuzOP4mBvNtt0iO20FbDxpBcdHVHkrS8aLyv7/6nDtWRJV48WID09Sy2CdM5Ugi2WTexVgMOGFCP4oYg0UFCQRiD9gQQkef8f8SnU7OyTgNkFuSvgXTS3VfL+1ZeUurdeSPC4kIYtxT/ZctnfJreu3eWQedgn0gg+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vNswA-00041h-Uo; Tue, 25 Nov 2025 14:18:30 +0100 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNswA-002PEY-24; Tue, 25 Nov 2025 14:18:30 +0100 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vNswA-0000000243F-2MRm; Tue, 25 Nov 2025 14:18:30 +0100 From: Ahmad Fatoum Date: Tue, 25 Nov 2025 14:18:19 +0100 Subject: [PATCH v2 1/2] initramfs: add gen_init_cpio to hostprogs unconditionally Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251125-cpio-modules-pkg-v2-1-aa8277d89682@pengutronix.de> References: <20251125-cpio-modules-pkg-v2-0-aa8277d89682@pengutronix.de> In-Reply-To: <20251125-cpio-modules-pkg-v2-0-aa8277d89682@pengutronix.de> To: Nathan Chancellor , Nicolas Schier Cc: Simon Glass , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Ahmad Fatoum X-Mailer: b4 0.14.2 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org gen_init_cpio is currently only needed when an initramfs cpio archive is to be created out of CONFIG_INITRAMFS_SOURCE's contents. In other cases, it's not added to hostprogs and no make target is available. In preparation to use the host program from Makefile.package, define it unconditionally. The program will still only be built as needed. Signed-off-by: Ahmad Fatoum Reviewed-by: Nathan Chancellor Reviewed-by: Simon Glass Reviewed-by: Thomas Wei=C3=9Fschuh Tested-by: Nathan Chancellor --- usr/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/Makefile b/usr/Makefile index f1779496bca78b4a56651b6af7221675ec7ade7a..e8f42478a0b76540180d191042c= d58d3e4381f19 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -16,6 +16,8 @@ obj-$(CONFIG_BLK_DEV_INITRD) :=3D initramfs_data.o =20 $(obj)/initramfs_data.o: $(obj)/initramfs_inc_data =20 +hostprogs :=3D gen_init_cpio + ramfs-input :=3D $(CONFIG_INITRAMFS_SOURCE) cpio-data :=3D =20 @@ -48,8 +50,6 @@ ifeq ($(cpio-data),) =20 cpio-data :=3D $(obj)/initramfs_data.cpio =20 -hostprogs :=3D gen_init_cpio - # .initramfs_data.cpio.d is used to identify all files included # in initramfs and to detect if any files are added/removed. # Removed files are identified by directory timestamp being updated --=20 2.47.3 From nobody Tue Dec 2 00:02:24 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 8DF82219A86 for ; Tue, 25 Nov 2025 13:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764076718; cv=none; b=OGcNS+SfKM/uz+bhFff/dfK72S1jgyp5U61NNi1q8ZAcoDt6FWXoxefhNL8XgfUs0jNh0pJ//cjHWqVtSiZ4uVwUDoLnd/XVlN1OtQROhJx3nf6SxUbsDBgJJwVL68/9gTSwsx6i/1gQD82MH1IRWPb4vhPAgWUkYy2iKKMpFgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764076718; c=relaxed/simple; bh=U3A6Xd9TSpMn+xkgCiCwE8rYfDb5pBA+PsQtjpsv/A0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T/WvczYn9E6a+xbrSDbKiNlSWqTaA4r3oSnOtBfQnLujS/MgIE6RQHJDRViszmiFmmG+NTWZdn6bbbjvGZwSnzZQ1OJNUjDbXpu5dO4yAeGnn0CBX2sdiZdLVP842K2v9TVt1xnTwHXCo6OpfIikb20akCslxCYuwxaTSQG1W9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vNswA-00041j-Uo; Tue, 25 Nov 2025 14:18:30 +0100 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNswA-002PEZ-24; Tue, 25 Nov 2025 14:18:30 +0100 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vNswA-0000000243F-2N7T; Tue, 25 Nov 2025 14:18:30 +0100 From: Ahmad Fatoum Date: Tue, 25 Nov 2025 14:18:20 +0100 Subject: [PATCH v2 2/2] kbuild: add target to build a cpio containing modules Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251125-cpio-modules-pkg-v2-2-aa8277d89682@pengutronix.de> References: <20251125-cpio-modules-pkg-v2-0-aa8277d89682@pengutronix.de> In-Reply-To: <20251125-cpio-modules-pkg-v2-0-aa8277d89682@pengutronix.de> To: Nathan Chancellor , Nicolas Schier Cc: Simon Glass , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Sascha Hauer , Ahmad Fatoum X-Mailer: b4 0.14.2 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: Sascha Hauer Add a new package target to build a cpio archive containing the kernel modules. This is particularly useful to supplement an existing initramfs with the kernel modules so that the root filesystem can be started with all needed kernel modules without modifying it. Signed-off-by: Sascha Hauer Reviewed-by: Simon Glass Tested-by: Simon Glass Co-developed-by: Ahmad Fatoum Signed-off-by: Ahmad Fatoum Reviewed-by: Nathan Chancellor Reviewed-by: Thomas Wei=C3=9Fschuh Tested-by: Nathan Chancellor Tested-by: Nicolas Schier --- scripts/Makefile.package | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 74bcb9e7f7a4516473481468a0fcf700c3bead33..83bfcf7cb09fd2d69b97e0c19a2= b99c728835e8d 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -189,6 +189,25 @@ tar-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar tar%-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar.% FORCE @: =20 +# modules-cpio-pkg - generate an initramfs with the modules +# ------------------------------------------------------------------------= --- + +.tmp_modules_cpio: FORCE + $(Q)$(MAKE) -f $(srctree)/Makefile + $(Q)rm -rf $@ + $(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=3D$@ modules_install + +quiet_cmd_cpio =3D CPIO $@ + cmd_cpio =3D $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $< + +modules-$(KERNELRELEASE)-$(ARCH).cpio: .tmp_modules_cpio + $(Q)$(MAKE) $(build)=3Dusr usr/gen_init_cpio + $(call cmd,cpio) + +PHONY +=3D modules-cpio-pkg +modules-cpio-pkg: modules-$(KERNELRELEASE)-$(ARCH).cpio + @: + # perf-tar*-src-pkg - generate a source tarball with perf source # ------------------------------------------------------------------------= --- =20 @@ -245,6 +264,7 @@ help: @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tar= ball' @echo ' tarxz-pkg - Build the kernel as a xz compressed tarbal= l' @echo ' tarzst-pkg - Build the kernel as a zstd compressed tarb= all' + @echo ' modules-cpio-pkg - Build the kernel modules as cpio archive' @echo ' perf-tar-src-pkg - Build the perf source tarball with no comp= ression' @echo ' perf-targz-src-pkg - Build the perf source tarball with gzip co= mpression' @echo ' perf-tarbz2-src-pkg - Build the perf source tarball with bz2 com= pression' --=20 2.47.3