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