18971c
From 197e4c90b95f2d9e57104d3b462918c335494697 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Tue, 25 Aug 2015 11:15:59 +0200
18971c
Subject: [PATCH] iscsi/parse-iscsiroot.sh: do not modify netroot
18971c
18971c
---
18971c
 modules.d/95iscsi/parse-iscsiroot.sh | 17 +++++++++++++----
18971c
 1 file changed, 13 insertions(+), 4 deletions(-)
18971c
18971c
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
18971c
index 91cd4630..e9444a5f 100755
18971c
--- a/modules.d/95iscsi/parse-iscsiroot.sh
18971c
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
18971c
@@ -16,10 +16,17 @@
18971c
 # This script is sourced, so root should be set. But let's be paranoid
18971c
 [ -z "$root" ] && root=$(getarg root=)
18971c
 if [ -z "$netroot" ]; then
18971c
-    for netroot in $(getargs netroot=); do
18971c
-        [ "${netroot%%:*}" = "iscsi" ] && break
18971c
+    for nroot in $(getargs netroot=); do
18971c
+        [ "${nroot%%:*}" = "iscsi" ] && break
18971c
     done
18971c
-    [ "${netroot%%:*}" = "iscsi" ] || unset netroot
18971c
+    if [ "${nroot%%:*}" = "iscsi" ]; then
18971c
+        netroot="$nroot"
18971c
+    else
18971c
+        for nroot in $(getargs netroot=); do
18971c
+            [ "${nroot%%:*}" = "dhcp" ] && break
18971c
+        done
18971c
+        netroot="$nroot"
18971c
+    fi
18971c
 fi
18971c
 [ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=)
18971c
 [ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1"
18971c
@@ -65,7 +72,9 @@ fi
18971c
 
18971c
 # iscsi_firmware does not need argument checking
18971c
 if [ -n "$iscsi_firmware" ] || getargbool 0 rd.iscsi.ibft -d "ip=ibft"; then
18971c
-    [ -z "$netroot" ] && netroot=iscsi:
18971c
+    if [ "$root" != "dhcp" ] && [ "$netroot" != "dhcp" ]; then
18971c
+        [ -z "$netroot" ] && netroot=iscsi:
18971c
+    fi
18971c
     modprobe -b -q iscsi_boot_sysfs 2>/dev/null
18971c
     modprobe -b -q iscsi_ibft
18971c
     # if no ip= is given, but firmware