9abf8c
From ba1a065c528bd5774c61a3c286e9a7ed7cc467e8 Mon Sep 17 00:00:00 2001
9abf8c
From: Martin Wilck <mwilck@suse.de>
9abf8c
Date: Thu, 21 Mar 2019 14:40:33 +0100
9abf8c
Subject: [PATCH] iscsi: fix error messages with iSCSI root
9abf8c
9abf8c
Fixes these error messages during intird build:
9abf8c
9abf8c
cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
9abf8c
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
9abf8c
cat: '/sys/devices/platform/host3/flashnode_sess-*/is_boot_target': No such file or directory
9abf8c
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
9abf8c
9abf8c
(cherry picked from commit 78efd6988ec6b39ea80ba8e432d7df1abe1c081f)
9abf8c
9abf8c
Resolves: #1552619
9abf8c
---
9abf8c
 modules.d/95iscsi/module-setup.sh | 1 +
9abf8c
 1 file changed, 1 insertion(+)
9abf8c
9abf8c
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
9abf8c
index dc63ef46..618d1dc2 100755
9abf8c
--- a/modules.d/95iscsi/module-setup.sh
9abf8c
+++ b/modules.d/95iscsi/module-setup.sh
9abf8c
@@ -86,6 +86,7 @@ install_iscsiroot() {
9abf8c
     iscsi_host=${host##*/}
9abf8c
 
9abf8c
     for flash in ${host}/flashnode_sess-* ; do
9abf8c
+        [ -f "$flash" ] || continue
9abf8c
         [ ! -e "$flash/is_boot_target" ] && continue
9abf8c
         is_boot=$(cat $flash/is_boot_target)
9abf8c
         if [ $is_boot -eq 1 ] ; then
9abf8c