2018-02-27 18:56:41 +00:00
|
|
|
From a7ff45890757a0edbd80fadb0e182d65d980d781 Mon Sep 17 00:00:00 2001
|
2016-03-04 18:32:29 +00:00
|
|
|
From: Raymund Will <rw@suse.com>
|
|
|
|
Date: Fri, 10 Apr 2015 01:45:02 -0400
|
2018-02-27 18:56:41 +00:00
|
|
|
Subject: [PATCH 151/206] Use device part of chainloader target, if present.
|
2016-03-04 18:32:29 +00:00
|
|
|
|
|
|
|
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
|
2018-02-27 18:56:41 +00:00
|
|
|
index adc85636633..14ce6ddd7ad 100644
|
2016-03-04 18:32:29 +00:00
|
|
|
--- a/grub-core/loader/efi/chainloader.c
|
|
|
|
+++ b/grub-core/loader/efi/chainloader.c
|
2017-06-16 19:31:32 +00:00
|
|
|
@@ -223,8 +223,11 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
2016-03-04 18:32:29 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
--
|
2018-02-27 18:56:41 +00:00
|
|
|
2.15.0
|
2016-03-04 18:32:29 +00:00
|
|
|
|