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