]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
rootfs-block: strip "ro|rw" options from fstab options
authorHarald Hoyer <harald@redhat.com>
Wed, 3 Feb 2010 16:24:23 +0000 (17:24 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 3 Feb 2010 16:24:51 +0000 (17:24 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=560424

modules.d/95rootfs-block/mount-root.sh

index 8c3b5867772c761ce63149083a0c5fc00047367d..62290abc40ccd357f810a9d5a8ae6c19d27d0ab9 100755 (executable)
@@ -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