]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
usrmount/mount-usr.sh: give emergency_shell if /usr mount failed
authorHarald Hoyer <harald@redhat.com>
Mon, 2 Jul 2012 16:51:20 +0000 (18:51 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 2 Jul 2012 16:54:07 +0000 (18:54 +0200)
modules.d/98usrmount/mount-usr.sh

index 5cf4eb8700ab62e16bda4fd76b6887d16b4bbb03..3173241130a6bb224c7cdbe8fa75dcfba841d61e 100755 (executable)
@@ -74,17 +74,21 @@ mount_usr()
             if [ "0" != "${_passno:-0}" ]; then
                 fsck_usr "$_dev" "$_fs" "$_opts"
                 _fsck_ret=$?
-                echo $_fsck_ret >/run/initramfs/usr-fsck
+                [ $_fsck_ret -ne 255 ] && echo $_fsck_ret >/run/initramfs/usr-fsck
             fi
         fi
-        if [ $_fsck_ret -ne 255 ]; then
-            if getargbool 0 rd.usrmount.ro; then
-                info "Mounting /usr (read-only forced)"
-                mount -r "$NEWROOT/usr" 2>&1 | vinfo
-            else
-                info "Mounting /usr"
-                mount "$NEWROOT/usr" 2>&1 | vinfo
-            fi
+        if getargbool 0 rd.usrmount.ro; then
+            info "Mounting /usr (read-only forced)"
+            mount -r "$NEWROOT/usr" 2>&1 | vinfo
+        else
+            info "Mounting /usr"
+            mount "$NEWROOT/usr" 2>&1 | vinfo
+        fi
+        if ! ismounted /usr; then
+            warn "Mounting /usr to $NEWROOT/usr failed"
+            warn "*** Dropping you to a shell; the system will continue"
+            warn "*** when you leave the shell."
+            emergency_shell
         fi
     fi
 }