dracut/0155-iscsi-iscsi.initiator-and-others-can-and-must-only-s.patch
Thomas Renninger 7604daf333 Accepting request 247544 from home:trenn:branches:Base:System
- Network module may take quite a lot of initrd space. Do not add it
  unconditionally (bnc#892851)
* Add 0153-Only-add-network-module-on-request-and-on-dependenci.patch
- S390x can do s2disk, allow resume module there
  (bnc#889795)
* Add 0154-resume-Also-allow-this-module-on-S390-again-s2disk-c.patch
- Harden iscsi parameter checking. No bug report, but this problem
  was found during multipath testing and happens with 2 or more
  iscsi devices.
* Add 0155-iscsi-iscsi.initiator-and-others-can-and-must-only-s.patch

OBS-URL: https://build.opensuse.org/request/show/247544
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=184
2014-09-04 13:06:46 +00:00

73 lines
3.2 KiB
Diff

From 26a858af5977a41b21839ce8411024bfe3f63dea Mon Sep 17 00:00:00 2001
From: Thomas Renninger <trenn@suse.de>
Date: Thu, 4 Sep 2014 13:36:18 +0200
Subject: iscsi: iscsi.initiator and others can and must only show up once
Make sure duplicates of iscsi.initiator vanish.
Only get one rd.iscsi.* paramter value. If getargs is used and several
parameters are parsed, one gets two values separated by whitespace in a
variable which breaks later code and is not suppported.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
modules.d/95iscsi/iscsiroot.sh | 18 +++++++++---------
modules.d/95iscsi/module-setup.sh | 5 ++++-
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index 1de6fb7..1c4be4e 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -83,23 +83,23 @@ handle_netroot()
local p
# override conf settings by command line options
- arg=$(getargs rd.iscsi.initiator -d iscsi_initiator=)
+ arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=)
[ -n "$arg" ] && iscsi_initiator=$arg
- arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
+ arg=$(getarg rd.iscsi.target.name -d iscsi_target_name=)
[ -n "$arg" ] && iscsi_target_name=$arg
- arg=$(getargs rd.iscsi.target.ip -d iscsi_target_ip)
+ arg=$(getarg rd.iscsi.target.ip -d iscsi_target_ip)
[ -n "$arg" ] && iscsi_target_ip=$arg
- arg=$(getargs rd.iscsi.target.port -d iscsi_target_port=)
+ arg=$(getarg rd.iscsi.target.port -d iscsi_target_port=)
[ -n "$arg" ] && iscsi_target_port=$arg
- arg=$(getargs rd.iscsi.target.group -d iscsi_target_group=)
+ arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=)
[ -n "$arg" ] && iscsi_target_group=$arg
- arg=$(getargs rd.iscsi.username -d iscsi_username=)
+ arg=$(getarg rd.iscsi.username -d iscsi_username=)
[ -n "$arg" ] && iscsi_username=$arg
- arg=$(getargs rd.iscsi.password -d iscsi_password)
+ arg=$(getarg rd.iscsi.password -d iscsi_password)
[ -n "$arg" ] && iscsi_password=$arg
- arg=$(getargs rd.iscsi.in.username -d iscsi_in_username=)
+ arg=$(getarg rd.iscsi.in.username -d iscsi_in_username=)
[ -n "$arg" ] && iscsi_in_username=$arg
- arg=$(getargs rd.iscsi.in.password -d iscsi_in_password=)
+ arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=)
[ -n "$arg" ] && iscsi_in_password=$arg
for p in $(getargs rd.iscsi.param -d iscsi_param); do
iscsi_param="$iscsi_param --param $p"
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 9772210..4784ea3 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -99,7 +99,10 @@ install_iscsiroot() {
iscsi_address="[$iscsi_address]"
;;
esac
- echo "rd.iscsi.initiator=${iscsi_initiator} netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
+ # Must be two separate lines, so that "sort | uniq" commands later
+ # can sort out rd.iscsi.initiator= duplicates
+ echo "rd.iscsi.initiator=${iscsi_initiator}"
+ echo "netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
fi
return 0
}
--
1.7.6.1