]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Do not embed when there are multiple (top-level) partmaps.
authorGrégoire Sutre <gregoire.sutre@gmail.com>
Sun, 4 Jul 2010 09:13:31 +0000 (11:13 +0200)
committerGrégoire Sutre <gregoire.sutre@gmail.com>
Sun, 4 Jul 2010 09:13:31 +0000 (11:13 +0200)
ChangeLog
util/i386/pc/grub-setup.c

index 090e04cef382d96c679e79ff757ecf1bcc91c466..136e4218595e4830f6d541a0ae6232a12d51055c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-04  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
+       * util/i386/pc/grub-setup.c (setup): Do not embed when there are
+       multiple (top-level) partmaps.
+
 2010-07-02  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Bidi and diacritics support.
index 9407c5d47de11dd25933f7e23e4ffaaf12f3cfde..3fe7d56225822f51a2c0f38707b399fb1e1f361d 100644 (file)
@@ -95,6 +95,7 @@ setup (const char *dir,
   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;
@@ -356,10 +357,17 @@ setup (const char *dir,
     {
       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)
@@ -367,6 +375,11 @@ setup (const char *dir,
       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 not supported yet."));
+      goto unable_to_embed;
+    }
 
   if (strcmp (dest_partmap, "msdos") == 0)
     grub_partition_iterate (dest_dev->disk, find_usable_region_msdos);