. /lib/dracut-lib.sh
+filter_rootopts() {
+ rootopts=$1
+ # 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#,}
+ echo $rootopts
+}
+
if [ -n "$root" -a -z "${root%%block:*}" ]; then
mount -t ${fstype:-auto} -o "$rflags" "${root#block:}" "$NEWROOT" \
- && ROOTFS_MOUNTED=yes
+ && ROOTFS_MOUNTED=yes
if ! getarg rd_NO_FSTAB \
&& ! getarg rootflags \
fi
done < "$NEWROOT/etc/fstab"
+ rootopts=$(filter_rootopts $rootopts)
- # 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 [ -n "$rootopts" -a "$rootopts" != "defaults" ]; then
umount $NEWROOT
info "Remounting ${root#block:} with -o $rootopts,$rflags"
mount -t "$rootfs" -o "$rflags","$rootopts" \