File 0598-iscsiroot-there-s-never-more-than-one-target-per-cal.patch of Package dracut

From 04657e60f00d53f52d47b7fd02b53618762340e4 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 4 Apr 2019 15:40:14 +0200
Subject: [PATCH 4/6] iscsiroot: there's never more than one target per call

iscsi_target_name is set by iscsi_root, and thus can't have
more than one member. This allows us to get rid of one bashism
in iscsiroot.sh.
---
 modules.d/95iscsi/iscsiroot.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Index: dracut-044/modules.d/95iscsi/iscsiroot.sh
===================================================================
--- dracut-044.orig/modules.d/95iscsi/iscsiroot.sh
+++ dracut-044/modules.d/95iscsi/iscsiroot.sh
@@ -221,8 +221,8 @@ handle_netroot()
         [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1
     fi
 
-    for target in $iscsi_target_name; do
-        if [[ "$targets" =~ "$target" ]]; then
+    for target in $targets; do
+        if [ "$target" = "$iscsi_target_name" ]; then
             if [ -n "$iscsi_iface_name" ]; then
                 $(iscsiadm -m iface -I $iscsi_iface_name --op=new)
                 [ -n "$iscsi_initiator" ] && $(iscsiadm -m iface -I $iscsi_iface_name --op=update --name=iface.initiatorname --value=$iscsi_initiator)
openSUSE Build Service is sponsored by