From e6047ee5e8b8f8208477d52e6765d893a2bde42a Mon Sep 17 00:00:00 2001 From: Johannes Schneider Date: Tue, 13 Feb 2024 13:24:25 +0100 Subject: [PATCH] initramfs-framework: overlayroot: align bootparams with module name Renaming the 'rootrw' kernel commandline parameter to 'overlayrootrwdev' to both align better with this modules name, and point out the usage of the variable. This patch also includes an if block to migrate the old 'rootrw' block, should it be already used by someone. (From OE-Core rev: a52b7f5c8ff3e50707b55843d9996983ab8efae2) Signed-off-by: Johannes Schneider Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- .../initrdscripts/initramfs-framework/overlayroot | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot b/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot index 10084228a8..0d41432878 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot +++ b/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot @@ -15,7 +15,7 @@ # accessing the original, unmodified rootfs at /rofs after boot. # # It relies on the initramfs-module-rootfs to mount the original -# root filesystem, and requires 'rootrw=' to be passed as a +# root filesystem, and requires 'overlayrootrwdev=' to be passed as a # kernel parameter, specifying the device/partition intended to # use as RW. # Mount options of the RW device can be tweaked with 'overlayrootfstype=' @@ -74,15 +74,19 @@ exit_gracefully() { eval "finish_run" } +# migrate legacy parameter +if [ ! -z "$bootparam_rootrw" ]; then + bootparam_overlayrootrwdev="$bootparam_rootrw" +fi -if [ -z "$bootparam_rootrw" ]; then - exit_gracefully "rootrw= kernel parameter doesn't exist and its required to mount the overlayfs" +if [ -z "$bootparam_overlayrootrwdev" ]; then + exit_gracefully "overlayrootrwdev= kernel parameter doesn't exist and its required to mount the overlayfs" fi mkdir -p ${RWMOUNT} # Mount RW device -if mount -n -t ${bootparam_overlayrootfstype:-ext4} -o ${bootparam_overlayrootfsflags:-defaults} ${bootparam_rootrw} ${RWMOUNT} +if mount -n -t ${bootparam_overlayrootfstype:-ext4} -o ${bootparam_overlayrootfsflags:-defaults} ${bootparam_overlayrootrwdev} ${RWMOUNT} then # Set up overlay directories mkdir -p ${UPPER_DIR}