18971c
From f45726652fd8c6fd6b5560e1142753bac62dc426 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Wed, 29 Jun 2016 10:49:00 +0200
18971c
Subject: [PATCH] fcoe: check if needed for hostonly
18971c
18971c
---
18971c
 modules.d/95fcoe-uefi/module-setup.sh | 8 ++++++++
18971c
 modules.d/95fcoe/module-setup.sh      | 9 +++++++++
18971c
 2 files changed, 17 insertions(+)
18971c
18971c
diff --git a/modules.d/95fcoe-uefi/module-setup.sh b/modules.d/95fcoe-uefi/module-setup.sh
18971c
index f5277f48..242363ef 100755
18971c
--- a/modules.d/95fcoe-uefi/module-setup.sh
18971c
+++ b/modules.d/95fcoe-uefi/module-setup.sh
18971c
@@ -4,6 +4,14 @@
18971c
 
18971c
 # called by dracut
18971c
 check() {
18971c
+    local _fcoe_ctlr
18971c
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
18971c
+        for c in /sys/bus/fcoe/devices/ctlr_* ; do
18971c
+            [ -L $c ] || continue
18971c
+            _fcoe_ctlr=$c
18971c
+        done
18971c
+        [ -z "$_fcoe_ctlr" ] && return 255
18971c
+    }
18971c
     [[ $hostonly ]] || [[ $mount_needs ]] && {
18971c
         [ -d /sys/firmware/efi ] || return 255
18971c
     }
18971c
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
18971c
index 646cfa84..ba10b0ab 100755
18971c
--- a/modules.d/95fcoe/module-setup.sh
18971c
+++ b/modules.d/95fcoe/module-setup.sh
18971c
@@ -3,6 +3,15 @@
18971c
 # ex: ts=8 sw=4 sts=4 et filetype=sh
18971c
 
18971c
 check() {
18971c
+    local _fcoe_ctlr
18971c
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
18971c
+        for c in /sys/bus/fcoe/devices/ctlr_* ; do
18971c
+            [ -L $c ] || continue
18971c
+            _fcoe_ctlr=$c
18971c
+        done
18971c
+        [ -z "$_fcoe_ctlr" ] && return 255
18971c
+    }
18971c
+
18971c
     require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1
18971c
     return 0
18971c
 }