Blame SOURCES/0127-fcoe-uefi-try-all-FcoeBootDevice-variables-for-a-Dev.patch

966cef
From 7633ef988a8b1e7611f2b8a64452c2d588ff89fb Mon Sep 17 00:00:00 2001
966cef
From: Harald Hoyer <harald@redhat.com>
966cef
Date: Wed, 19 Feb 2014 15:20:34 +0100
966cef
Subject: [PATCH] fcoe-uefi: try all FcoeBootDevice-* variables for a
966cef
 DevicePath
966cef
966cef
try to read the DevicePath from all FcoeBootDevice-* UEFI variables
966cef
until one has a MAC.
966cef
---
966cef
 modules.d/95fcoe-uefi/parse-uefifcoe.sh | 15 ++++++++-------
966cef
 1 file changed, 8 insertions(+), 7 deletions(-)
966cef
966cef
diff --git a/modules.d/95fcoe-uefi/parse-uefifcoe.sh b/modules.d/95fcoe-uefi/parse-uefifcoe.sh
966cef
index e03bcb3..0799cdd 100755
966cef
--- a/modules.d/95fcoe-uefi/parse-uefifcoe.sh
966cef
+++ b/modules.d/95fcoe-uefi/parse-uefifcoe.sh
966cef
@@ -9,10 +9,10 @@ command -v set_ifname >/dev/null || . /lib/net-lib.sh
966cef
 print_fcoe_uefi_conf()
966cef
 {
966cef
     local mac dev vlan
966cef
-    mac=$(get_fcoe_boot_mac)
966cef
-    [ -z "$mac" ] && continue
966cef
+    mac=$(get_fcoe_boot_mac "$1")
966cef
+    [ -z "$mac" ] && return 1
966cef
     dev=$(set_ifname fcoe $mac)
966cef
-    vlan=$(get_fcoe_boot_vlan)
966cef
+    vlan=$(get_fcoe_boot_vlan  "$1")
966cef
     if [ "$vlan" -ne "0" ]; then
966cef
         case "$vlan" in
966cef
             [0-9]*)
966cef
@@ -27,9 +27,10 @@ print_fcoe_uefi_conf()
966cef
     fi
966cef
     # fcoe=eth0:nodcb
966cef
     printf "%s\n" "$dev:nodcb"
966cef
+    return 0
966cef
 }
966cef
 
966cef
-
966cef
-if [ -e /sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data ]; then
966cef
-    print_fcoe_uefi_conf > /etc/cmdline.d/40-fcoe-uefi.conf
966cef
-fi
966cef
+for i in /sys/firmware/efi/vars/FcoeBootDevice-*/data; do
966cef
+    [ -e "$i" ] || continue
966cef
+    print_fcoe_uefi_conf $i > /etc/cmdline.d/40-fcoe-uefi.conf && break
966cef
+done