dracut/0103-iscsi-parse-iscsiroot.sh-do-not-modify-netroot.patch
Harald Hoyer bb31e7fe65 dracut-043-172.git20151113
- git snapshot
2015-11-13 16:51:52 +01:00

47 lines
1.7 KiB
Diff

From 6138a45dd20319417a59f0592f67ac261a380031 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 25 Aug 2015 11:15:59 +0200
Subject: [PATCH] iscsi/parse-iscsiroot.sh: do not modify netroot
(cherry picked from commit 197e4c90b95f2d9e57104d3b462918c335494697)
---
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 a889da1..c167dad 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -14,10 +14,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"
@@ -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