efidisk: Return the determined root disk even if partition is unknown.
This commit is contained in:
parent
eeea31b220
commit
7d027b4d3e
1 changed files with 6 additions and 7 deletions
|
@ -803,7 +803,6 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
|
|||
&& (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE
|
||||
|| GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))
|
||||
{
|
||||
int is_cdrom = 0;
|
||||
struct grub_efidisk_get_device_name_ctx ctx;
|
||||
char *dev_name;
|
||||
grub_efi_device_path_t *dup_dp;
|
||||
|
@ -824,9 +823,6 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
|
|||
|| GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)))
|
||||
break;
|
||||
|
||||
if (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE)
|
||||
is_cdrom = 1;
|
||||
|
||||
dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
|
||||
dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
|
||||
dup_ldp->length = sizeof (*dup_ldp);
|
||||
|
@ -861,10 +857,13 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
|
|||
|
||||
if (! ctx.partition_name)
|
||||
{
|
||||
/* No partition found. In most cases partition is embed in
|
||||
the root path anyway, so this is not critical.
|
||||
This happens only if partition is on partmap that GRUB
|
||||
doesn't need to access root.
|
||||
*/
|
||||
grub_disk_close (parent);
|
||||
if (is_cdrom)
|
||||
return grub_strdup (device_name);
|
||||
return 0;
|
||||
return grub_strdup (device_name);
|
||||
}
|
||||
|
||||
dev_name = grub_xasprintf ("%s,%s", parent->name,
|
||||
|
|
Loading…
Reference in a new issue