From 7ed1de2f1dc1ac7193284d7cb11ae327e1efe59c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 30 May 2011 17:26:44 +0200 Subject: [PATCH] mount-root.sh: fixed fsck and "-a" only for "ext*" --- modules.d/95rootfs-block/mount-root.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh index 9334323b..eccc0197 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