]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
provide name based nbd connects
authorWim Muskee <wimmuskee@gmail.com>
Sat, 17 Mar 2012 11:33:55 +0000 (12:33 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 21 Mar 2012 12:06:49 +0000 (13:06 +0100)
Because nbd-server also provides name-based exports instead of
port-based ones, make it possible to connect to those.

modules.d/95nbd/nbdroot.sh

index e20b4e45e4f11a2fc4f1775f992fc0ca1e5e6f82..0e7dd9bd670bf98f80d6bd66259c58752be35b9d 100755 (executable)
@@ -30,6 +30,11 @@ nbdfstype=${root%%:*}; root=${root#*:}
 nbdflags=${root%%:*}
 nbdopts=${root#*:}
 
+# If nbdport not an integer, then assume name based import
+if [[ $nbdport != [0-9]* ]]; then
+    nbdport="-N $nbdport"
+fi
+
 if [ "$nbdopts" = "$nbdflags" ]; then
     unset nbdopts
 fi