1de2d2
From ee0bba8d350920b8beb4c0629262ec359983ad65 Mon Sep 17 00:00:00 2001
1de2d2
From: Martin Wilck <mwilck@suse.de>
1de2d2
Date: Tue, 1 Oct 2019 12:02:04 +0200
1de2d2
Subject: [PATCH] fixup "Dracut: only login to one target at a time"
1de2d2
1de2d2
On SLE15-SP1 at least, iscsiadm doesn't support combining --op and --login":
1de2d2
1de2d2
> # iscsiadm -m node -T iqn.2018-06.de.suse.zeus:01 --op=update  --name=node.startup --value=onboot --login
1de2d2
> iscsiadm: Invalid parameters. Login/logout and op passed in
1de2d2
1de2d2
This breaks iSCSI login in initrd, and thus, iSCSI boot.
1de2d2
1de2d2
Fix it by not coalescing everything into a single iscsiadm command.
1de2d2
Fixes: a59b776bc215 ("Dracut: only login to one target at a time")
1de2d2
References: bsc#1152650
1de2d2
---
1de2d2
 modules.d/95iscsi/iscsiroot.sh | 6 +++---
1de2d2
 1 file changed, 3 insertions(+), 3 deletions(-)
1de2d2
1de2d2
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
1de2d2
index 4ab0b6a0..6a12a108 100755
1de2d2
--- a/modules.d/95iscsi/iscsiroot.sh
1de2d2
+++ b/modules.d/95iscsi/iscsiroot.sh
1de2d2
@@ -225,8 +225,8 @@ handle_netroot()
1de2d2
 
1de2d2
             CMD="iscsiadm -m node -T $target \
1de2d2
                      ${iscsi_iface_name:+-I $iscsi_iface_name} \
1de2d2
-                     -p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port} \
1de2d2
-                     --op=update \
1de2d2
+                     -p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port}"
1de2d2
+            __op="--op=update \
1de2d2
                      --name=node.startup --value=onboot \
1de2d2
                      ${iscsi_username:+   --name=node.session.auth.username    --value=$iscsi_username} \
1de2d2
                      ${iscsi_password:+   --name=node.session.auth.password    --value=$iscsi_password} \
1de2d2
@@ -234,7 +234,7 @@ handle_netroot()
1de2d2
                      ${iscsi_in_password:+--name=node.session.auth.password_in --value=$iscsi_in_password} \
1de2d2
                      $EXTRA \
1de2d2
                      $NULL"
1de2d2
-            $CMD
1de2d2
+            $CMD $__op
1de2d2
             if [ "$netif" != "timeout" ]; then
1de2d2
                 $CMD --login
1de2d2
             fi
1de2d2