type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
[ -z "$root" ] && root=$(getarg root=)
[ "${root%%:*}" = "nbd" ] || exit 0
[ -z "$GENERATOR_DIR" ] && exit 1
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
ROOTFLAGS="$(getarg rootflags)"
nbdserver=${nroot%%:*}; nroot=${nroot#*:}
nbdport=${nroot%%:*}; nroot=${nroot#*:}
nbdfstype=${nroot%%:*}; nroot=${nroot#*:}
if [ "$nbdflags" = "$nbdfstype" ]; then
if [ "$nbdfstype" = "$nbdport" ]; then
[ -n "$nbdflags" ] && ROOTFLAGS="$nbdflags"
if [ -n "$ROOTFLAGS" ]; then
ROOTFLAGS="$ROOTFLAGS,ro"
if [ -n "$nbdfstype" ]; then
ROOTFSTYPE=$(getarg rootfstype=) || unset ROOTFSTYPE
echo "Before=initrd-root-fs.target"
[ -n "$ROOTFSTYPE" ] && echo "Type=${ROOTFSTYPE}"
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
} > "$GENERATOR_DIR"/sysroot.mount