Blame SOURCES/0219-Use-device-part-of-chainloader-target-if-present.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Raymund Will <rw@suse.com>
a85e8e
Date: Fri, 10 Apr 2015 01:45:02 -0400
d41074
Subject: [PATCH] Use device part of chainloader target, if present.
a85e8e
a85e8e
Otherwise chainloading is restricted to '$root', which might not even
a85e8e
be readable by EFI!
a85e8e
a85e8e
v1. use grub_file_get_device_name() to get device name
a85e8e
a85e8e
Signed-off-by: Michael Chang <mchang@suse.com>
a85e8e
Signed-off-by: Peter Jones <pjones@redhat.com>
a85e8e
---
a85e8e
 grub-core/loader/efi/chainloader.c | 7 +++++--
a85e8e
 1 file changed, 5 insertions(+), 2 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
d41074
index adc85636633..14ce6ddd7ad 100644
a85e8e
--- a/grub-core/loader/efi/chainloader.c
a85e8e
+++ b/grub-core/loader/efi/chainloader.c
a85e8e
@@ -223,8 +223,11 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
a85e8e
   if (! file)
a85e8e
     goto fail;
a85e8e
 
a85e8e
-  /* Get the root device's device path.  */
a85e8e
-  dev = grub_device_open (0);
a85e8e
+  /* Get the device path from filename. */
a85e8e
+  char *devname = grub_file_get_device_name (filename);
a85e8e
+  dev = grub_device_open (devname);
a85e8e
+  if (devname)
a85e8e
+    grub_free (devname);
a85e8e
   if (! dev)
a85e8e
     goto fail;
a85e8e