rootfs-block: strip "ro|rw" options from fstab options

https://bugzilla.redhat.com/show_bug.cgi?id=560424
master
Harald Hoyer 2010-02-03 17:24:23 +01:00
parent 54aaad9dad
commit d43036ffeb
1 changed files with 21 additions and 1 deletions

View File

@ -23,9 +23,29 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
fi fi
done < "$NEWROOT/etc/fstab" 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 if [ "$rootopts" != "defaults" ]; then
umount $NEWROOT umount $NEWROOT
info "Remounting ${root#block:} with -o $rflags,$rootopts" info "Remounting ${root#block:} with -o $rootopts,$rflags"
mount -t "$rootfs" -o "$rflags","$rootopts" \ mount -t "$rootfs" -o "$rflags","$rootopts" \
"${root#block:}" "$NEWROOT" 2>&1 | vinfo "${root#block:}" "$NEWROOT" 2>&1 | vinfo
fi fi