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

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