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

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