]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
initramfs-framework: overlayroot: align bootparams with module name
authorJohannes Schneider <johannes.schneider@leica-geosystems.com>
Tue, 13 Feb 2024 12:24:25 +0000 (13:24 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Feb 2024 14:56:12 +0000 (14:56 +0000)
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.

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-core/initrdscripts/initramfs-framework/overlayroot

index 10084228a89d36aa4c61ff4bbfaefea2af5b0c13..0d414328789f1abcb72629b644c386b7947ac51d 100644 (file)
@@ -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=<foo>' to be passed as a
+# root filesystem, and requires 'overlayrootrwdev=<foo>' 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}