]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
95rootfs-block: fix left fsck rel. checks
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Thu, 26 Jul 2012 13:05:21 +0000 (15:05 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 26 Jul 2012 14:35:13 +0000 (16:35 +0200)
modules.d/95rootfs-block/mount-root.sh

index 670f6e3b3d0eb64f1fb091e2485e570cdd7b6ef9..ef8ca3ceb64b9800778e0f4eb2ffe33d3edc58d8 100755 (executable)
@@ -52,11 +52,11 @@ mount_root() {
         fastboot=yes
     fi
 
-    if [ -f "$NEWROOT"/fsckoptions ]; then
-        fsckoptions=$(cat "$NEWROOT"/fsckoptions)
-    fi
-
     if ! getargbool 0 rd.skipfsck; then
+        if [ -f "$NEWROOT"/fsckoptions ]; then
+            fsckoptions=$(cat "$NEWROOT"/fsckoptions)
+        fi
+
         if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck ; then
             fsckoptions="-f $fsckoptions"
         elif [ -f "$NEWROOT"/.autofsck ]; then
@@ -130,8 +130,10 @@ mount_root() {
         mount -o remount "$NEWROOT" 2>&1 | vinfo
     fi
 
-    [ -f "$NEWROOT"/forcefsck ] && rm -f "$NEWROOT"/forcefsck 2>/dev/null
-    [ -f "$NEWROOT"/.autofsck ] && rm -f "$NEWROOT"/.autofsck 2>/dev/null
+    if ! getargbool 0 rd.skipfsck; then
+        [ -f "$NEWROOT"/forcefsck ] && rm -f "$NEWROOT"/forcefsck 2>/dev/null
+        [ -f "$NEWROOT"/.autofsck ] && rm -f "$NEWROOT"/.autofsck 2>/dev/null
+    fi
 }
 
 if [ -n "$root" -a -z "${root%%block:*}" ]; then