diff mbox series

initramfs-framework: add handover of PID 1's arguments

Message ID 20260116113029.2952509-1-u.oelmann@pengutronix.de
State New
Headers show
Series initramfs-framework: add handover of PID 1's arguments | expand

Commit Message

Ulrich Ölmann Jan. 16, 2026, 11:30 a.m. UTC
Although many PID 1 programs parse /proc/cmdline, let's follow the standard
convention and forward the command-line arguments received from the kernel to
the next PID 1 program.
---
 meta/recipes-core/initrdscripts/initramfs-framework/finish | 2 +-
 meta/recipes-core/initrdscripts/initramfs-framework/init   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish
index 21eaa5739343..69d555368d4c 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/finish
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -42,7 +42,7 @@  finish_run() {
 		mount --move /run $ROOTFS_DIR/run
 
 		cd $ROOTFS_DIR
-		exec switch_root $ROOTFS_DIR ${bootparam_init:-/sbin/init}
+		exec switch_root $ROOTFS_DIR ${bootparam_init:-/sbin/init} "$@"
 	else
 		debug "No rootfs has been set"
 	fi
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init
index fe6e3cbf0782..51db083e2e53 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/init
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -154,7 +154,7 @@  for m in $MODULES_DIR/*; do
 	fi
 
 	debug "Running ${module}_run"
-	eval "${module}_run"
+	eval "${module}_run" "$@"
 
 	# post hooks
 	for h in $MODULE_POST_HOOKS; do