Blame SOURCES/0321-iscsi-parse-iscsiroot.sh-do-not-modify-netroot.patch

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