dracut/0105-95iscsi-parse-output-from-iscsiadm-correctly.patch
Marcus Meissner d695f6da8a Accepting request 239877 from home:hreinecke:branches:Base:System
- Print stored dracut commandline during initramfs build
  * Add: 0101-Print-stored-dracut-commandline-during-initramfs-bui.patch
- Align dev_unit_name() with systemd's function
  * Add: 0102-Align-dev_unit_name-with-systemd-s-function.patch
- Fixup missing separators in rootfs-block cmdline
  * Add: 0103-Fixup-missing-separators-in-rootfs-block-cmdline.patch
- Generate fallback mount unit for root filesystem (bnc#855258)
  * Add: 0104-Generate-fallback-mount-unit-for-root-filesystem.patch
- 95iscsi: parse output from iscsiadm correctly (bnc#886199)
  * Add: 0105-95iscsi-parse-output-from-iscsiadm-correctly.patch

OBS-URL: https://build.opensuse.org/request/show/239877
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=169
2014-07-09 12:01:24 +00:00

48 lines
1.4 KiB
Diff

From a852317e8338ffb94fa1ac9512d465ac8c72cdc0 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 8 Jul 2014 13:16:41 +0200
Subject: 95iscsi: parse output from iscsiadm correctly
Due to some obsure reason the IFS parameter is not set correctly
when evaluating get_ibft_mod(). So change the parsing to not rely
on IFS altogether.
References: bnc#886199
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
modules.d/95iscsi/module-setup.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 81ffb18..f63634a 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -3,15 +3,15 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
get_ibft_mod() {
- local ibft_mac=$1 IFS
+ local ibft_mac=$1
+ local iface_mac iface_mod
# Return the iSCSI offload module for a given MAC address
- iscsiadm -m iface | while read iface_name iface_desc ; do
- OLDIFS="$IFS"
- IFS=$','
- set -- $iface_desc
- IFS="$OLDIFS"
- if [ "$ibft_mac" = "$2" ] ; then
- echo $1
+ for iface_desc in $(iscsiadm -m iface | cut -f 2 -d ' '); do
+ iface_mod=${iface_desc%%,*}
+ iface_mac=${iface_desc#*,}
+ iface_mac=${iface_mac%%,*}
+ if [ "$ibft_mac" = "$iface_mac" ] ; then
+ echo $iface_mod
return 0
fi
--
1.8.4.5