Blame 0102-fcoe-check-if-needed-for-hostonly.patch

Harald Hoyer 414eba
From 5a3773dbe6b48a872295d6a10f87e5329f0113a1 Mon Sep 17 00:00:00 2001
Harald Hoyer 414eba
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 414eba
Date: Wed, 29 Jun 2016 10:49:00 +0200
Harald Hoyer 414eba
Subject: [PATCH] fcoe: check if needed for hostonly
Harald Hoyer 414eba
Harald Hoyer 414eba
(cherry picked from commit f45726652fd8c6fd6b5560e1142753bac62dc426)
Harald Hoyer 414eba
---
Harald Hoyer 414eba
 modules.d/95fcoe-uefi/module-setup.sh | 8 ++++++++
Harald Hoyer 414eba
 modules.d/95fcoe/module-setup.sh      | 5 +++--
Harald Hoyer 414eba
 2 files changed, 11 insertions(+), 2 deletions(-)
Harald Hoyer 414eba
Harald Hoyer 414eba
diff --git a/modules.d/95fcoe-uefi/module-setup.sh b/modules.d/95fcoe-uefi/module-setup.sh
Harald Hoyer 414eba
index 5d8477c..c9ff3c2 100755
Harald Hoyer 414eba
--- a/modules.d/95fcoe-uefi/module-setup.sh
Harald Hoyer 414eba
+++ b/modules.d/95fcoe-uefi/module-setup.sh
Harald Hoyer 414eba
@@ -2,6 +2,14 @@
Harald Hoyer 414eba
 
Harald Hoyer 414eba
 # called by dracut
Harald Hoyer 414eba
 check() {
Harald Hoyer 414eba
+    local _fcoe_ctlr
Harald Hoyer 414eba
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
Harald Hoyer 414eba
+        for c in /sys/bus/fcoe/devices/ctlr_* ; do
Harald Hoyer 414eba
+            [ -L $c ] || continue
Harald Hoyer 414eba
+            _fcoe_ctlr=$c
Harald Hoyer 414eba
+        done
Harald Hoyer 414eba
+        [ -z "$_fcoe_ctlr" ] && return 255
Harald Hoyer 414eba
+    }
Harald Hoyer 414eba
     [[ $hostonly ]] || [[ $mount_needs ]] && {
Harald Hoyer 414eba
         [ -d /sys/firmware/efi ] || return 255
Harald Hoyer 414eba
     }
Harald Hoyer 414eba
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
Harald Hoyer 414eba
index 059bfde..531ea0d 100755
Harald Hoyer 414eba
--- a/modules.d/95fcoe/module-setup.sh
Harald Hoyer 414eba
+++ b/modules.d/95fcoe/module-setup.sh
Harald Hoyer 414eba
@@ -2,12 +2,13 @@
Harald Hoyer 414eba
 
Harald Hoyer 414eba
 # called by dracut
Harald Hoyer 414eba
 check() {
Harald Hoyer 414eba
+    local _fcoe_ctlr
Harald Hoyer 414eba
     [[ $hostonly ]] || [[ $mount_needs ]] && {
Harald Hoyer 414eba
         for c in /sys/bus/fcoe/devices/ctlr_* ; do
Harald Hoyer 414eba
             [ -L $c ] || continue
Harald Hoyer 414eba
-            fcoe_ctlr=$c
Harald Hoyer 414eba
+            _fcoe_ctlr=$c
Harald Hoyer 414eba
         done
Harald Hoyer 414eba
-        [ -z "$fcoe_ctlr" ] && return 255
Harald Hoyer 414eba
+        [ -z "$_fcoe_ctlr" ] && return 255
Harald Hoyer 414eba
     }
Harald Hoyer 414eba
 
Harald Hoyer 414eba
     require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1