From 197e4c90b95f2d9e57104d3b462918c335494697 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 25 Aug 2015 11:15:59 +0200 Subject: [PATCH] iscsi/parse-iscsiroot.sh: do not modify netroot --- modules.d/95iscsi/parse-iscsiroot.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh index 91cd463..e9444a5 100755 --- a/modules.d/95iscsi/parse-iscsiroot.sh +++ b/modules.d/95iscsi/parse-iscsiroot.sh @@ -16,10 +16,17 @@ # 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" @@ -65,7 +72,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 # if no ip= is given, but firmware