From: Harald Hoyer Date: Mon, 30 May 2011 15:26:44 +0000 (+0200) Subject: mount-root.sh: fixed fsck and "-a" only for "ext*" X-Git-Tag: 011~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ed1de2f1dc1ac7193284d7cb11ae327e1efe59c;p=thirdparty%2Fdracut.git mount-root.sh: fixed fsck and "-a" only for "ext*" --- diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh index 9334323b0..eccc01978 100755 --- a/modules.d/95rootfs-block/mount-root.sh +++ b/modules.d/95rootfs-block/mount-root.sh @@ -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