]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
mount-root.sh: fixed fsck and "-a" only for "ext*"
authorHarald Hoyer <harald@redhat.com>
Mon, 30 May 2011 15:26:44 +0000 (17:26 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 31 May 2011 12:56:30 +0000 (14:56 +0200)
modules.d/95rootfs-block/mount-root.sh

index 9334323b05f9d3598ec5c7f4f9760ed203e26304..eccc0197877d98cda9221874ca48187e55788392 100755 (executable)
@@ -69,7 +69,7 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
         fsckoptions="$AUTOFSCK_OPT $fsckoptions"
     fi
 
-    if ! strstr " $fsckoptions" " -y"; then
+    if ! strstr " $fsckoptions" " -y" && strstr "$rootfs" ext; then
         fsckoptions="-a $fsckoptions"
     fi
 
@@ -99,7 +99,11 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
 
     umount "$NEWROOT"
 
-    if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
+    # backslashes are treated as escape character in fstab
+    esc_root=$(echo ${root#block:} | sed 's,\\,\\\\,g')
+    printf '%s %s %s %s,%s 1 1 \n' "$esc_root" "$NEWROOT" "$rootfs" "$rflags" "$rootopts"  > /etc/fstab
+
+    if [ -x "/sbin/fsck.$rootfs" -a -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
         wrap_fsck "${root#block:}" "$fsckoptions"
         echo $? >/run/initramfs/root-fsck
     fi