]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
initrdscripts: add UBI support
authorWalter Schweizer <walter.schweizer@siemens.com>
Mon, 16 Dec 2024 14:46:42 +0000 (15:46 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Jan 2025 12:36:45 +0000 (12:36 +0000)
Mounting the rootfs failed when it was on UBI.
This patch allows the rootfs to live on UBI.

Signed-off-by: Walter Schweizer <walter.schweizer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/initramfs-framework/rootfs

index 38e138f618e661b6f164ae980f10908e30522240..df0cbfb091a654907227817f1efafd8dae2013e6 100644 (file)
@@ -33,9 +33,11 @@ rootfs_run() {
                        elif [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
                                root_label=`echo $bootparam_root | cut -c7-`
                                bootparam_root="/dev/disk/by-label/$root_label"
+                       elif echo "${bootparam_root}" | grep -q '^ubi[0-9]\+:'; then
+                               bootparam_rootfstype="ubifs"
                        fi
 
-                       if [ -e "$bootparam_root" ]; then
+                       if [ -e "$bootparam_root" ] || [ -n "$bootparam_rootfstype" ]; then
                                flags=""
                                if [ -n "$bootparam_ro" ] && ! echo "$bootparam_rootflags" | grep -w -q "ro"; then
                                        if [  -n "$bootparam_rootflags" ]; then
@@ -49,6 +51,7 @@ rootfs_run() {
                                if [ -n "$bootparam_rootfstype" ]; then
                                        flags="$flags -t$bootparam_rootfstype"
                                fi
+                               debug "mount $flags $bootparam_root $ROOTFS_DIR"
                                mount $flags $bootparam_root $ROOTFS_DIR
                                if mountpoint -q $ROOTFS_DIR; then
                                        break