Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/dracut/modules..../95virtfs
File: mount-virtfs.sh
#!/bin/sh
[0] Fix | Delete
[1] Fix | Delete
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
[2] Fix | Delete
[3] Fix | Delete
filter_rootopts() {
[4] Fix | Delete
rootopts=$1
[5] Fix | Delete
# strip ro and rw options
[6] Fix | Delete
local OLDIFS="$IFS"
[7] Fix | Delete
IFS=,
[8] Fix | Delete
set -- $rootopts
[9] Fix | Delete
IFS="$OLDIFS"
[10] Fix | Delete
local v
[11] Fix | Delete
while [ $# -gt 0 ]; do
[12] Fix | Delete
case $1 in
[13] Fix | Delete
rw|ro);;
[14] Fix | Delete
defaults);;
[15] Fix | Delete
*)
[16] Fix | Delete
v="$v,${1}";;
[17] Fix | Delete
esac
[18] Fix | Delete
shift
[19] Fix | Delete
done
[20] Fix | Delete
rootopts=${v#,}
[21] Fix | Delete
echo $rootopts
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
mount_root() {
[25] Fix | Delete
local _ret
[26] Fix | Delete
[27] Fix | Delete
rootfs="9p"
[28] Fix | Delete
rflags="trans=virtio,version=9p2000.L"
[29] Fix | Delete
[30] Fix | Delete
modprobe 9pnet_virtio
[31] Fix | Delete
[32] Fix | Delete
mount -t ${rootfs} -o "$rflags",ro "${root#virtfs:}" "$NEWROOT"
[33] Fix | Delete
[34] Fix | Delete
rootopts=
[35] Fix | Delete
if getargbool 1 rd.fstab -n rd_NO_FSTAB \
[36] Fix | Delete
&& ! getarg rootflags \
[37] Fix | Delete
&& [ -f "$NEWROOT/etc/fstab" ] \
[38] Fix | Delete
&& ! [ -L "$NEWROOT/etc/fstab" ]; then
[39] Fix | Delete
# if $NEWROOT/etc/fstab contains special mount options for
[40] Fix | Delete
# the root filesystem,
[41] Fix | Delete
# remount it with the proper options
[42] Fix | Delete
rootopts="defaults"
[43] Fix | Delete
while read dev mp fs opts rest || [ -n "$dev" ]; do
[44] Fix | Delete
# skip comments
[45] Fix | Delete
[ "${dev%%#*}" != "$dev" ] && continue
[46] Fix | Delete
[47] Fix | Delete
if [ "$mp" = "/" ]; then
[48] Fix | Delete
rootopts=$opts
[49] Fix | Delete
break
[50] Fix | Delete
fi
[51] Fix | Delete
done < "$NEWROOT/etc/fstab"
[52] Fix | Delete
[53] Fix | Delete
rootopts=$(filter_rootopts $rootopts)
[54] Fix | Delete
fi
[55] Fix | Delete
[56] Fix | Delete
# we want rootflags (rflags) to take precedence so prepend rootopts to
[57] Fix | Delete
# them; rflags is guaranteed to not be empty
[58] Fix | Delete
rflags="${rootopts:+"${rootopts},"}${rflags}"
[59] Fix | Delete
[60] Fix | Delete
umount "$NEWROOT"
[61] Fix | Delete
[62] Fix | Delete
info "Remounting ${root#virtfs:} with -o ${rflags}"
[63] Fix | Delete
mount -t ${rootfs} -o "$rflags" "${root#virtfs:}" "$NEWROOT" 2>&1 | vinfo
[64] Fix | Delete
[65] Fix | Delete
[ -f "$NEWROOT"/forcefsck ] && rm -f -- "$NEWROOT"/forcefsck 2>/dev/null
[66] Fix | Delete
[ -f "$NEWROOT"/.autofsck ] && rm -f -- "$NEWROOT"/.autofsck 2>/dev/null
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
if [ -n "$root" -a -z "${root%%virtfs:*}" ]; then
[70] Fix | Delete
mount_root
[71] Fix | Delete
fi
[72] Fix | Delete
:
[73] Fix | Delete
[74] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function