]> code.ossystems Code Review - openembedded-core.git/commitdiff
initramfs-framework: support init boot parameter
authorPatrick Ohly <patrick.ohly@intel.com>
Tue, 8 Sep 2015 11:19:01 +0000 (13:19 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Sep 2015 21:47:20 +0000 (22:47 +0100)
It can be useful for debugging to override the default /sbin/init.
This is something typically done via the init boot parameter which
then gets interpreted by the kernel. But when using an initramfs, it
is the initramfs which must react to the option.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/initrdscripts/initramfs-framework/finish

index a8806aa3afa85d43bada720fe78fcecbf2c94de2..e712ff03c64e379115841e5c0742b79a9c6e197b 100755 (executable)
@@ -53,7 +53,7 @@ finish_run() {
                mount --move /sys $ROOTFS_DIR/sys
 
                cd $ROOTFS_DIR
-               exec switch_root -c /dev/console $ROOTFS_DIR /sbin/init
+               exec switch_root -c /dev/console $ROOTFS_DIR ${bootparam_init:-/sbin/init}
        else
                debug "No rootfs has been set"
        fi