Blob Blame History Raw
From ba1a065c528bd5774c61a3c286e9a7ed7cc467e8 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Thu, 21 Mar 2019 14:40:33 +0100
Subject: [PATCH] iscsi: fix error messages with iSCSI root

Fixes these error messages during intird build:

cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
cat: '/sys/devices/platform/host3/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected

(cherry picked from commit 78efd6988ec6b39ea80ba8e432d7df1abe1c081f)

Resolves: #1552619
---
 modules.d/95iscsi/module-setup.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index dc63ef46..618d1dc2 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -86,6 +86,7 @@ install_iscsiroot() {
     iscsi_host=${host##*/}
 
     for flash in ${host}/flashnode_sess-* ; do
+        [ -f "$flash" ] || continue
         [ ! -e "$flash/is_boot_target" ] && continue
         is_boot=$(cat $flash/is_boot_target)
         if [ $is_boot -eq 1 ] ; then