]>
git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/95virtfs/mount-virtfs.sh
7c07b46284f485c46c9793f533db3b97daf21948
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
5 type getarg
>/dev
/null
2>&1 || .
/lib
/dracut-lib.sh
9 # strip ro and rw options
15 while [ $# -gt 0 ]; do
32 rflags
="trans=virtio,version=9p2000.L"
36 mount
-t ${rootfs} -o "$rflags",ro
"${root#virtfs:}" "$NEWROOT"
39 if getargbool
1 rd.fstab
-n rd_NO_FSTAB \
40 && ! getarg rootflags \
41 && [ -f "$NEWROOT/etc/fstab" ] \
42 && ! [ -L "$NEWROOT/etc/fstab" ]; then
43 # if $NEWROOT/etc/fstab contains special mount options for
44 # the root filesystem,
45 # remount it with the proper options
47 while read dev mp fs opts rest
; do
49 [ "${dev%%#*}" != "$dev" ] && continue
51 if [ "$mp" = "/" ]; then
55 done < "$NEWROOT/etc/fstab"
57 rootopts
=$
(filter_rootopts
$rootopts)
60 # we want rootflags (rflags) to take precedence so prepend rootopts to
61 # them; rflags is guaranteed to not be empty
62 rflags
="${rootopts:+"${rootopts},"}${rflags}"
66 info
"Remounting ${root#virtfs:} with -o ${rflags}"
67 mount
-t ${rootfs} -o "$rflags" "${root#virtfs:}" "$NEWROOT" 2>&1 | vinfo
69 [ -f "$NEWROOT"/forcefsck
] && rm -f "$NEWROOT"/forcefsck
2>/dev
/null
70 [ -f "$NEWROOT"/.autofsck
] && rm -f "$NEWROOT"/.autofsck
2>/dev
/null
73 if [ -n "$root" -a -z "${root%%virtfs:*}" ]; then