]>
git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/95nbd/nbd-generator.sh
3 type getarg
>/dev
/null
2>&1 || .
/lib
/dracut-lib.sh
5 [ -z "$root" ] && root
=$
(getarg root
=)
7 [ "${root%%:*}" = "nbd" ] ||
exit 0
10 [ -z "$GENERATOR_DIR" ] && exit 1
12 [ -d "$GENERATOR_DIR" ] || mkdir
-p "$GENERATOR_DIR"
14 ROOTFLAGS
="$(getarg rootflags)"
17 nbdserver
=${nroot%%:*}; nroot
=${nroot#*:}
18 nbdport
=${nroot%%:*}; nroot
=${nroot#*:}
19 nbdfstype
=${nroot%%:*}; nroot
=${nroot#*:}
22 if [ "$nbdflags" = "$nbdfstype" ]; then
25 if [ "$nbdfstype" = "$nbdport" ]; then
29 [ -n "$nbdflags" ] && ROOTFLAGS
="$nbdflags"
32 if [ -n "$ROOTFLAGS" ]; then
33 ROOTFLAGS
="$ROOTFLAGS,ro"
39 if [ -n "$nbdfstype" ]; then
40 ROOTFSTYPE
="$nbdfstype"
42 ROOTFSTYPE
=$
(getarg rootfstype
=) ||
unset ROOTFSTYPE
47 echo "Before=initrd-root-fs.target"
51 [ -n "$ROOTFSTYPE" ] && echo "Type=${ROOTFSTYPE}"
52 [ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
53 } > "$GENERATOR_DIR"/sysroot.mount