* grub-core/kern/efi/init.c (grub_efi_set_prefix): If the prefix

starts with "(,", fill the drive containing the loaded image in
between those two characters, but expect that a full partition
specification including partition map names will follow.
This commit is contained in:
Colin Watson 2010-09-08 13:53:47 +01:00
parent 92f2aef045
commit 6fa6d6751d
2 changed files with 33 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2010-09-08 Colin Watson <cjwatson@ubuntu.com>
* grub-core/kern/efi/init.c (grub_efi_set_prefix): If the prefix
starts with "(,", fill the drive containing the loaded image in
between those two characters, but expect that a full partition
specification including partition map names will follow.
2010-09-08 Robert Millan <rmh@gnu.org>
* configure.ac: Remove `--enable-grub-fstest' option.

View file

@ -66,10 +66,33 @@ grub_efi_set_prefix (void)
path = grub_strdup (pptr);
}
if (!device || !path)
if ((!device || device[0] == ',' || !device[0]) || !path)
image = grub_efi_get_loaded_image (grub_efi_image_handle);
if (image && !device)
device = grub_efidisk_get_device_name (image->device_handle);
if (image)
{
if (!device)
device = grub_efidisk_get_device_name (image->device_handle);
else if (device[0] == ',' || !device[0])
{
/* We have a partition, but still need to fill in the drive. */
char *image_device, *comma, *new_device;
image_device = grub_efidisk_get_device_name (image->device_handle);
comma = grub_strchr (image_device, ',');
if (comma)
{
char *drive = grub_strndup (image_device, comma - image_device);
new_device = grub_xasprintf ("%s%s", drive, device);
grub_free (drive);
}
else
new_device = grub_xasprintf ("%s%s", image_device, device);
grub_free (image_device);
grub_free (device);
device = new_device;
}
}
if (image && !path)
{