]> code.ossystems Code Review - openembedded-core.git/commitdiff
initramfs-framework: check successful mount using mountpoint
authorStefan Agner <stefan.agner@toradex.com>
Wed, 3 Jun 2020 19:50:11 +0000 (19:50 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Jun 2020 12:42:01 +0000 (13:42 +0100)
Instead of checking for existence of /dev in the mounted file system use
mountpoint to check if a root file system has been mounted. This allows
to use the rootfs module for OSTree based rootfs as well, where the file
system rootfs does not have any of the regular directories (at least
when using the modern layout).

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/initramfs-framework/rootfs

index 748c9391c04422d66e0c429c10e98f523c5b66b5..ee24e82af3b69856b6d778c7bbef8e5893dbe55d 100644 (file)
@@ -13,7 +13,7 @@ rootfs_run() {
        C=0
        delay=${bootparam_rootdelay:-1}
        timeout=${bootparam_roottimeout:-5}
-       while [ ! -d $ROOTFS_DIR/dev ]; do
+       while ! mountpoint -q $ROOTFS_DIR; do
                if [ $(( $C * $delay )) -gt $timeout ]; then
                        fatal "root '$bootparam_root' doesn't exist or does not contain a /dev."
                fi
@@ -61,7 +61,7 @@ rootfs_run() {
                                        flags="$flags -t$bootparam_rootfstype"
                                fi
                                mount $flags $bootparam_root $ROOTFS_DIR
-                               if [ -d $ROOTFS_DIR/dev ]; then
+                               if mountpoint -q $ROOTFS_DIR; then
                                        break
                                else
                                        # It is unlikely to change, but keep trying anyway.