diff --git a/ChangeLog b/ChangeLog index 2e7a4f3a5..1ac7a70a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-24 Vladimir Serbinenko + + * util/i386/pc/grub-setup.c (setup): Fix bug when + installing on partionless disk. + 2009-07-23 Pavel Roskin * commands/xnu_uuid.c (transform): Use GRUB_CPU_WORDS_BIGENDIAN diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 5a519645b..852b49894 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -329,10 +329,18 @@ setup (const char *dir, dest_partmap = p->partmap->name; return 1; } + dest_partmap = 0; grub_partition_iterate (dest_dev->disk, identify_partmap); + if (! dest_partmap) + { + grub_util_warn ("Attempting to install GRUB to a partitionless disk. This is a BAD idea."); + goto unable_to_embed; + } + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? find_usable_region_gpt : find_usable_region_msdos)); + if (embed_region.end == embed_region.start) { if (! strcmp (dest_partmap, "pc_partition_map"))