Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../lib/dracut/modules..../95nbd
File: nbd-generator.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
[ -z "$root" ] && root=$(getarg root=)
[4] Fix | Delete
[5] Fix | Delete
[ "${root%%:*}" = "nbd" ] || exit 0
[6] Fix | Delete
[7] Fix | Delete
GENERATOR_DIR="$2"
[8] Fix | Delete
[ -z "$GENERATOR_DIR" ] && exit 1
[9] Fix | Delete
[10] Fix | Delete
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
[11] Fix | Delete
[12] Fix | Delete
ROOTFLAGS="$(getarg rootflags)"
[13] Fix | Delete
[14] Fix | Delete
nroot=${root#nbd:}
[15] Fix | Delete
nbdserver=${nroot%%:*}; nroot=${nroot#*:}
[16] Fix | Delete
nbdport=${nroot%%:*}; nroot=${nroot#*:}
[17] Fix | Delete
nbdfstype=${nroot%%:*}; nroot=${nroot#*:}
[18] Fix | Delete
nbdflags=${nroot%%:*}
[19] Fix | Delete
[20] Fix | Delete
if [ "$nbdflags" = "$nbdfstype" ]; then
[21] Fix | Delete
unset nbdflags
[22] Fix | Delete
fi
[23] Fix | Delete
if [ "$nbdfstype" = "$nbdport" ]; then
[24] Fix | Delete
unset nbdfstype
[25] Fix | Delete
fi
[26] Fix | Delete
[27] Fix | Delete
[ -n "$nbdflags" ] && ROOTFLAGS="$nbdflags"
[28] Fix | Delete
[29] Fix | Delete
if getarg "ro"; then
[30] Fix | Delete
if [ -n "$ROOTFLAGS" ]; then
[31] Fix | Delete
ROOTFLAGS="$ROOTFLAGS,ro"
[32] Fix | Delete
else
[33] Fix | Delete
ROOTFLAGS="ro"
[34] Fix | Delete
fi
[35] Fix | Delete
fi
[36] Fix | Delete
[37] Fix | Delete
if [ -n "$nbdfstype" ]; then
[38] Fix | Delete
ROOTFSTYPE="$nbdfstype"
[39] Fix | Delete
else
[40] Fix | Delete
ROOTFSTYPE=$(getarg rootfstype=) || unset ROOTFSTYPE
[41] Fix | Delete
fi
[42] Fix | Delete
[43] Fix | Delete
{
[44] Fix | Delete
echo "[Unit]"
[45] Fix | Delete
echo "Before=initrd-root-fs.target"
[46] Fix | Delete
echo "[Mount]"
[47] Fix | Delete
echo "Where=/sysroot"
[48] Fix | Delete
echo "What=/dev/root"
[49] Fix | Delete
[ -n "$ROOTFSTYPE" ] && echo "Type=${ROOTFSTYPE}"
[50] Fix | Delete
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
[51] Fix | Delete
} > "$GENERATOR_DIR"/sysroot.mount
[52] Fix | Delete
[53] Fix | Delete
exit 0
[54] Fix | Delete
[55] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function