Blame SOURCES/0395-fcoe-check-if-needed-for-hostonly.patch

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