73ad23
From 81b59fbbd6ebeee05b5d6869ae4f36bb9e486f72 Mon Sep 17 00:00:00 2001
73ad23
From: Lukas Nykryn <lnykryn@redhat.com>
73ad23
Date: Tue, 8 Jan 2019 17:16:07 +0100
73ad23
Subject: [PATCH] 95iscsi: rd.iscsi.initiator should have priority over stored
73ad23
 configuration
73ad23
73ad23
(cherry picked from commit 61afc704548cecc7f7d2fa3b5f1319e790cc5bee)
73ad23
73ad23
Resolves: #1664062
73ad23
---
73ad23
 modules.d/95iscsi/parse-iscsiroot.sh | 15 +++++++--------
73ad23
 1 file changed, 7 insertions(+), 8 deletions(-)
73ad23
73ad23
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
73ad23
index 7a64d888..f00a83bb 100755
73ad23
--- a/modules.d/95iscsi/parse-iscsiroot.sh
73ad23
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
73ad23
@@ -107,14 +107,13 @@ if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [
73ad23
     iscsi_initiator=$arg
73ad23
     echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
73ad23
     ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
73ad23
-    if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
73ad23
-        mkdir -p /etc/iscsi
73ad23
-        ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
73ad23
-        if [ -n "$DRACUT_SYSTEMD" ]; then
73ad23
-            systemctl try-restart iscsid
73ad23
-            # FIXME: iscsid is not yet ready, when the service is :-/
73ad23
-            sleep 1
73ad23
-        fi
73ad23
+    rm -f /etc/iscsi/initiatorname.iscsi
73ad23
+    mkdir -p /etc/iscsi
73ad23
+    ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
73ad23
+    if [ -n "$DRACUT_SYSTEMD" ]; then
73ad23
+        systemctl try-restart iscsid
73ad23
+        # FIXME: iscsid is not yet ready, when the service is :-/
73ad23
+        sleep 1
73ad23
     fi
73ad23
 fi
73ad23
 
73ad23