]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi/parse-iscsiroot.sh: do not modify netroot
authorHarald Hoyer <harald@redhat.com>
Tue, 25 Aug 2015 09:15:59 +0000 (11:15 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 11 Nov 2015 14:21:27 +0000 (15:21 +0100)
(cherry picked from commit 197e4c90b95f2d9e57104d3b462918c335494697)

modules.d/95iscsi/parse-iscsiroot.sh

index a889da185831461cee399411d7d6f5f3cb1a4e74..c167dade430bca05aade4f21439521774b1a4f57 100755 (executable)
 # This script is sourced, so root should be set. But let's be paranoid
 [ -z "$root" ] && root=$(getarg root=)
 if [ -z "$netroot" ]; then
-    for netroot in $(getargs netroot=); do
-        [ "${netroot%%:*}" = "iscsi" ] && break
+    for nroot in $(getargs netroot=); do
+        [ "${nroot%%:*}" = "iscsi" ] && break
     done
-    [ "${netroot%%:*}" = "iscsi" ] || unset netroot
+    if [ "${nroot%%:*}" = "iscsi" ]; then
+        netroot="$nroot"
+    else
+        for nroot in $(getargs netroot=); do
+            [ "${nroot%%:*}" = "dhcp" ] && break
+        done
+        netroot="$nroot"
+    fi
 fi
 [ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=)
 [ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1"
@@ -59,7 +66,9 @@ fi
 
 # iscsi_firmware does not need argument checking
 if [ -n "$iscsi_firmware" ] || getargbool 0 rd.iscsi.ibft -d "ip=ibft"; then
-    [ -z "$netroot" ] && netroot=iscsi:
+    if [ "$root" != "dhcp" ] && [ "$netroot" != "dhcp" ]; then
+        [ -z "$netroot" ] && netroot=iscsi:
+    fi
     modprobe -b -q iscsi_boot_sysfs 2>/dev/null
     modprobe -b -q iscsi_ibft
 fi