]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-07-24 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Fri, 24 Jul 2009 20:41:31 +0000 (20:41 +0000)
committerphcoder <phcoder@localhost>
Fri, 24 Jul 2009 20:41:31 +0000 (20:41 +0000)
* util/i386/pc/grub-setup.c (setup): Fix bug when
installing on partionless disk.

ChangeLog
util/i386/pc/grub-setup.c

index 2e7a4f3a5c400f173981ad3acc6a68c82539ae2f..1ac7a70a9bf0c92492a5388754c56a846a914192 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/i386/pc/grub-setup.c (setup): Fix bug when
+       installing on partionless disk.
+
 2009-07-23  Pavel Roskin  <proski@gnu.org>
 
        * commands/xnu_uuid.c (transform): Use GRUB_CPU_WORDS_BIGENDIAN
index 5a519645b83f9f95b65d80f18bdab49b25096467..852b49894fcf4f92e44c8fa0772426dffd7b0959 100644 (file)
@@ -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"))