You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.5 KiB

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