=== modified file 'ChangeLog' --- ChangeLog 2010-06-17 20:54:04 +0000 +++ ChangeLog 2010-06-17 22:06:58 +0000 @@ -1,3 +1,8 @@ +2010-06-17 Grégoire Sutre + + * util/i386/pc/grub-setup.c (setup): Do not embed when there are + multiple (top-level) partmaps. + 2010-06-17 Colin Watson * util/i386/pc/grub-setup.c (usage): Pass an extra `program_name' === modified file 'util/i386/pc/grub-setup.c' --- util/i386/pc/grub-setup.c 2010-06-17 20:54:04 +0000 +++ util/i386/pc/grub-setup.c 2010-06-17 22:04:48 +0000 @@ -93,6 +93,7 @@ grub_uint16_t core_sectors; grub_device_t root_dev, dest_dev; const char *dest_partmap; + int multiple_partmaps; grub_uint8_t *boot_drive; grub_disk_addr_t *kernel_sector; grub_uint16_t *boot_drive_check; @@ -354,10 +355,17 @@ { if (p->parent) return 0; - dest_partmap = p->partmap->name; - return 1; + if (dest_partmap == NULL) + dest_partmap = p->partmap->name; + else if (strcmp (dest_partmap, p->partmap->name) != 0) + { + multiple_partmaps = 1; + return 1; + } + return 0; } dest_partmap = 0; + multiple_partmaps = 0; grub_partition_iterate (dest_dev->disk, identify_partmap); if (! dest_partmap) @@ -365,6 +373,11 @@ grub_util_warn (_("Attempting to install GRUB to a partitionless disk. This is a BAD idea.")); goto unable_to_embed; } + if (multiple_partmaps) + { + grub_util_warn (_("Attempting to install GRUB to a disk with multiple partition labels. This is a BAD idea.")); + goto unable_to_embed; + } if (strcmp (dest_partmap, "msdos") == 0) grub_partition_iterate (dest_dev->disk, find_usable_region_msdos);