grub2/0151-Use-device-part-of-chainloader-target-if-present.patch
Peter Jones 6f1e3d5698 Dump a bunch of work-in-progress patches for now.
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-01-17 17:04:51 -05:00

38 lines
1.2 KiB
Diff

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