]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
new option: rd.skipfsck to skip fsck for rootfs and /usr
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Fri, 29 Jun 2012 11:58:20 +0000 (13:58 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 2 Jul 2012 16:52:49 +0000 (18:52 +0200)
dracut.cmdline.7.asc
modules.d/95rootfs-block/mount-root.sh
modules.d/98usrmount/mount-usr.sh

index 5669700e8e3a7e2f2656b19270e3e692e4884670..3bfb53ae1795c3ffc3cd104c557d2c4a21d39296 100644 (file)
@@ -75,6 +75,10 @@ resume=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
 resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
 ----
 
+**rd.skipfsck**::
+    skip fsck for rootfs and _/usr_.  If you're mounting _/usr_ read-only and
+    the init system performs fsck before remount, you might want to use this
+    option to avoid duplication.
 
 **rd.usrmount.ro**:
     force mounting _/usr_ read-only.  Use this option if your init system
index 2cae526bea6ece3b4cb98e599cc2ad1324891605..910963866ba905298b87e8fbe13d621967f4d0f9 100755 (executable)
@@ -103,7 +103,9 @@ mount_root() {
     # printf '%s %s %s %s 1 1 \n' "$esc_root" "$NEWROOT" "$rootfs" "$rflags" >/etc/fstab
 
     ran_fsck=0
-    if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
+    if [ -z "$fastboot" -a "$READONLY" != "yes" ] && \
+            ! strstr "${rflags},${rootopts}" _netdev && \
+            ! getargbool 0 rd.skipfsck; then
         umount "$NEWROOT"
         fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions"
         _ret=$?
index 748ac0121dc9c5bba3bc3e6c19a6053998bf8fc1..57987770ee646be277620e12ab3038229d2c2008 100755 (executable)
@@ -60,14 +60,15 @@ mount_usr()
 
     if [ "x$_usr_found" != "x" ]; then
         # we have to mount /usr
-        if [ "0" != "${_passno:-0}" ]; then
-            fsck_usr "$_dev" "$_fs" "$_opts"
-        else
-            :
+        _fsck_ret=0
+        if ! getargbool 0 rd.skipfsck; then
+            if [ "0" != "${_passno:-0}" ]; then
+                fsck_usr "$_dev" "$_fs" "$_opts"
+                _fsck_ret=$?
+                echo $_fsck_ret >/run/initramfs/usr-fsck
+            fi
         fi
-        _ret=$?
-        echo $_ret >/run/initramfs/usr-fsck
-        if [ $_ret -ne 255 ]; then
+        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