dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone
Blob Blame History Raw
From 224bdbee2e9cc9a9aaa198cec9b984bb1fa0ee73 Mon Sep 17 00:00:00 2001
From: RHEL Ninjas <example@example.com>
Date: Mon, 13 Apr 2015 12:42:53 +1000
Subject: [PATCH 20/23] don't strip fw_path twice for EFI network boot

---
 grub-core/kern/efi/init.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
index 942ab02..c391df4 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -61,7 +61,12 @@ grub_machine_get_bootlocation (char **device, char **path)
   *device = grub_efidisk_get_device_name (image->device_handle);
   *path = grub_efi_get_filename (image->file_path);
   if (!*device && grub_efi_net_config)
-    grub_efi_net_config (image->device_handle, device, path);
+    {
+      grub_efi_net_config (image->device_handle, device, path);
+      /* grub_efi_net_config returns the directory path, not the boot filename,
+         so don't strip any further. */
+      return;
+    }
 
   /* Get the directory.  */
   p = grub_strrchr (*path, '/');
-- 
2.4.3