+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>
* tests/partmap_test.in: Skip on ppc due to serious firmware bug.
continue;
if (grub_efi_compare_device_paths (parent->device_path, dp) == 0)
- {
- /* Found. */
- if (! parent->last_device_path)
- parent = 0;
-
- break;
- }
+ break;
}
grub_free (dp);
parent = find_parent_device (devices, d);
if (!parent)
{
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("skipping orphaned partition: ");
- grub_efi_print_device_path (parent->device_path);
+ grub_efi_print_device_path (d->device_path);
#endif
break;
}
parent2 = find_parent_device (devices, parent);
if (parent2)
{
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("skipping subpartition: ");
- grub_efi_print_device_path (parent->device_path);
+ grub_efi_print_device_path (d->device_path);
#endif
/* Mark itself as used. */
d->last_device_path = 0;
break;
}
+ if (!parent->last_device_path)
+ {
+ d->last_device_path = 0;
+ break;
+ }
if (is_hard_drive)
{
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("adding a hard drive by a partition: ");
grub_efi_print_device_path (parent->device_path);
#endif
}
else
{
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("adding a cdrom by a partition: ");
grub_efi_print_device_path (parent->device_path);
#endif
break;
default:
+#ifdef DEBUG_NAMES
+ grub_printf ("skipping other type: ");
+ grub_efi_print_device_path (d->device_path);
+#endif
/* For now, ignore the others. */
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. */
{
/* Only one partition in a non-media device. Assume that this
is a floppy drive. */
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("adding a floppy by guessing: ");
grub_efi_print_device_path (d->device_path);
#endif
{
/* This check is too heuristic, but assume that this is a
CDROM drive. */
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("adding a cdrom by guessing: ");
grub_efi_print_device_path (d->device_path);
#endif
else
{
/* The default is a hard drive. */
-#if 0
+#ifdef DEBUG_NAMES
grub_printf ("adding a hard drive by guessing: ");
grub_efi_print_device_path (d->device_path);
#endif