Mounting the rootfs failed when it was on UBI.
This patch allows the rootfs to live on UBI.

Signed-off-by: Walter Schweizer <[email protected]>
---
 meta/recipes-core/initrdscripts/initramfs-framework/rootfs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs 
b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
index 38e138f618..df0cbfb091 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
@@ -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
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208770): 
https://lists.openembedded.org/g/openembedded-core/message/208770
Mute This Topic: https://lists.openembedded.org/mt/110145279/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to