type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
# strip ro and rw options
rflags="trans=virtio,version=9p2000.L"
mount -t ${rootfs} -o "$rflags",ro "${root#virtfs:}" "$NEWROOT"
if getargbool 1 rd.fstab -n rd_NO_FSTAB \
&& [ -f "$NEWROOT/etc/fstab" ] \
&& ! [ -L "$NEWROOT/etc/fstab" ]; then
# if $NEWROOT/etc/fstab contains special mount options for
# remount it with the proper options
while read dev mp fs opts rest || [ -n "$dev" ]; do
[ "${dev%%#*}" != "$dev" ] && continue
done < "$NEWROOT/etc/fstab"
rootopts=$(filter_rootopts $rootopts)
# we want rootflags (rflags) to take precedence so prepend rootopts to
# them; rflags is guaranteed to not be empty
rflags="${rootopts:+"${rootopts},"}${rflags}"
info "Remounting ${root#virtfs:} with -o ${rflags}"
mount -t ${rootfs} -o "$rflags" "${root#virtfs:}" "$NEWROOT" 2>&1 | vinfo
[ -f "$NEWROOT"/forcefsck ] && rm -f -- "$NEWROOT"/forcefsck 2>/dev/null
[ -f "$NEWROOT"/.autofsck ] && rm -f -- "$NEWROOT"/.autofsck 2>/dev/null
if [ -n "$root" -a -z "${root%%virtfs:*}" ]; then