From: Harald Hoyer Date: Wed, 3 Feb 2010 16:24:23 +0000 (+0100) Subject: rootfs-block: strip "ro|rw" options from fstab options X-Git-Tag: 005~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d43036ffeb88d9270ba079cd1a125242a856740f;p=thirdparty%2Fdracut.git rootfs-block: strip "ro|rw" options from fstab options https://bugzilla.redhat.com/show_bug.cgi?id=560424 --- diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh index 8c3b58677..62290abc4 100755 --- a/modules.d/95rootfs-block/mount-root.sh +++ b/modules.d/95rootfs-block/mount-root.sh @@ -23,9 +23,29 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then fi done < "$NEWROOT/etc/fstab" + + # strip ro and rw options + { + local OLDIFS=$IFS + IFS=, + set -- $rootopts + IFS=$OLDIFS + local v + while [ $# -gt 0 ]; do + case $1 in + rw|ro);; + *) + v="$v,${1}";; + esac + shift + done + rootopts=${v#,} + } + + if [ "$rootopts" != "defaults" ]; then umount $NEWROOT - info "Remounting ${root#block:} with -o $rflags,$rootopts" + info "Remounting ${root#block:} with -o $rootopts,$rflags" mount -t "$rootfs" -o "$rflags","$rootopts" \ "${root#block:}" "$NEWROOT" 2>&1 | vinfo fi