* grub-core/disk/efi/efidisk.c (find_parent_device): Return the parent

even if it's used.
	(name_devices): Replace #if 0 with #ifdef DEBUG_NAMES.
	Skip if parent is unused.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-06-09 10:43:24 +02:00
parent 34b2bced3f
commit a176740446
2 changed files with 33 additions and 16 deletions

View file

@ -1,3 +1,10 @@
2012-06-09 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/efi/efidisk.c (find_parent_device): Return the parent
even if it's used.
(name_devices): Replace #if 0 with #ifdef DEBUG_NAMES.
Skip if parent is unused.
2012-06-08 Vladimir Serbinenko <phcoder@gmail.com> 2012-06-08 Vladimir Serbinenko <phcoder@gmail.com>
* tests/partmap_test.in: Skip on ppc due to serious firmware bug. * tests/partmap_test.in: Skip on ppc due to serious firmware bug.

View file

@ -167,14 +167,8 @@ find_parent_device (struct grub_efidisk_data *devices,
continue; continue;
if (grub_efi_compare_device_paths (parent->device_path, dp) == 0) if (grub_efi_compare_device_paths (parent->device_path, dp) == 0)
{
/* Found. */
if (! parent->last_device_path)
parent = 0;
break; break;
} }
}
grub_free (dp); grub_free (dp);
return parent; return parent;
@ -276,26 +270,31 @@ name_devices (struct grub_efidisk_data *devices)
parent = find_parent_device (devices, d); parent = find_parent_device (devices, d);
if (!parent) if (!parent)
{ {
#if 0 #ifdef DEBUG_NAMES
grub_printf ("skipping orphaned partition: "); grub_printf ("skipping orphaned partition: ");
grub_efi_print_device_path (parent->device_path); grub_efi_print_device_path (d->device_path);
#endif #endif
break; break;
} }
parent2 = find_parent_device (devices, parent); parent2 = find_parent_device (devices, parent);
if (parent2) if (parent2)
{ {
#if 0 #ifdef DEBUG_NAMES
grub_printf ("skipping subpartition: "); grub_printf ("skipping subpartition: ");
grub_efi_print_device_path (parent->device_path); grub_efi_print_device_path (d->device_path);
#endif #endif
/* Mark itself as used. */ /* Mark itself as used. */
d->last_device_path = 0; d->last_device_path = 0;
break; break;
} }
if (!parent->last_device_path)
{
d->last_device_path = 0;
break;
}
if (is_hard_drive) if (is_hard_drive)
{ {
#if 0 #ifdef DEBUG_NAMES
grub_printf ("adding a hard drive by a partition: "); grub_printf ("adding a hard drive by a partition: ");
grub_efi_print_device_path (parent->device_path); grub_efi_print_device_path (parent->device_path);
#endif #endif
@ -303,7 +302,7 @@ name_devices (struct grub_efidisk_data *devices)
} }
else else
{ {
#if 0 #ifdef DEBUG_NAMES
grub_printf ("adding a cdrom by a partition: "); grub_printf ("adding a cdrom by a partition: ");
grub_efi_print_device_path (parent->device_path); grub_efi_print_device_path (parent->device_path);
#endif #endif
@ -318,10 +317,21 @@ name_devices (struct grub_efidisk_data *devices)
break; break;
default: default:
#ifdef DEBUG_NAMES
grub_printf ("skipping other type: ");
grub_efi_print_device_path (d->device_path);
#endif
/* For now, ignore the others. */ /* For now, ignore the others. */
break; break;
} }
} }
else
{
#ifdef DEBUG_NAMES
grub_printf ("skipping non-media: ");
grub_efi_print_device_path (d->device_path);
#endif
}
} }
/* Let's see what can be added more. */ /* Let's see what can be added more. */
@ -339,7 +349,7 @@ name_devices (struct grub_efidisk_data *devices)
{ {
/* Only one partition in a non-media device. Assume that this /* Only one partition in a non-media device. Assume that this
is a floppy drive. */ is a floppy drive. */
#if 0 #ifdef DEBUG_NAMES
grub_printf ("adding a floppy by guessing: "); grub_printf ("adding a floppy by guessing: ");
grub_efi_print_device_path (d->device_path); grub_efi_print_device_path (d->device_path);
#endif #endif
@ -349,7 +359,7 @@ name_devices (struct grub_efidisk_data *devices)
{ {
/* This check is too heuristic, but assume that this is a /* This check is too heuristic, but assume that this is a
CDROM drive. */ CDROM drive. */
#if 0 #ifdef DEBUG_NAMES
grub_printf ("adding a cdrom by guessing: "); grub_printf ("adding a cdrom by guessing: ");
grub_efi_print_device_path (d->device_path); grub_efi_print_device_path (d->device_path);
#endif #endif
@ -358,7 +368,7 @@ name_devices (struct grub_efidisk_data *devices)
else else
{ {
/* The default is a hard drive. */ /* The default is a hard drive. */
#if 0 #ifdef DEBUG_NAMES
grub_printf ("adding a hard drive by guessing: "); grub_printf ("adding a hard drive by guessing: ");
grub_efi_print_device_path (d->device_path); grub_efi_print_device_path (d->device_path);
#endif #endif