From: Raymund Will Subject: Use device part of chainloader target, if present. References: bnc#871857, bnc#880177 Patch-Mainline: no 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 --- grub-core/loader/efi/chainloader.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) Index: grub-2.04~rc1/grub-core/loader/efi/chainloader.c =================================================================== --- grub-2.04~rc1.orig/grub-core/loader/efi/chainloader.c +++ grub-2.04~rc1/grub-core/loader/efi/chainloader.c @@ -714,12 +714,16 @@ grub_cmd_chainloader (grub_command_t cmd *(--p16) = 0; } + grub_dprintf ("chain", "cmd='%s'\n", filename); file = grub_file_open (filename, GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE); 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;