Blame 0034-make-nbd-port-check-more-robust.patch

Harald Hoyer fe31f8
From c6a71c7b8a2fdfb4d946553dee2068ef484858c3 Mon Sep 17 00:00:00 2001
Harald Hoyer fe31f8
From: Wim Muskee <wimmuskee@gmail.com>
Harald Hoyer fe31f8
Date: Sat, 9 Feb 2013 12:54:20 +0100
Harald Hoyer fe31f8
Subject: [PATCH] make nbd port check more robust
Harald Hoyer fe31f8
Harald Hoyer fe31f8
The following change makes the check for the nbd port or named export
Harald Hoyer fe31f8
more robust.
Harald Hoyer fe31f8
I wasn't sure whether to include sed in the dracut_install() of
Harald Hoyer fe31f8
module-setup.sh since net already does that (and nbd depends on that).
Harald Hoyer fe31f8
---
Harald Hoyer fe31f8
 modules.d/95nbd/nbdroot.sh | 2 +-
Harald Hoyer fe31f8
 1 file changed, 1 insertion(+), 1 deletion(-)
Harald Hoyer fe31f8
Harald Hoyer fe31f8
diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh
Harald Hoyer fe31f8
index 4d06425..b176a16 100755
Harald Hoyer fe31f8
--- a/modules.d/95nbd/nbdroot.sh
Harald Hoyer fe31f8
+++ b/modules.d/95nbd/nbdroot.sh
Harald Hoyer fe31f8
@@ -31,7 +31,7 @@ nbdflags=${root%%:*}
Harald Hoyer fe31f8
 nbdopts=${root#*:}
Harald Hoyer fe31f8
 
Harald Hoyer fe31f8
 # If nbdport not an integer, then assume name based import
Harald Hoyer fe31f8
-if [ "${nbdport%[0-9]}" = "$nbdport" ]; then
Harald Hoyer fe31f8
+if [ ! -z $(echo "$nbdport" | sed 's/[0-9]//g') ]; then
Harald Hoyer fe31f8
     nbdport="-N $nbdport"
Harald Hoyer fe31f8
 fi
Harald Hoyer fe31f8