]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/commands/gptsync.c (grub_cmd_gptsync): Propagate the
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 30 May 2012 11:51:50 +0000 (13:51 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 30 May 2012 11:51:50 +0000 (13:51 +0200)
relaxation of protective MBR requirements.

ChangeLog
grub-core/commands/gptsync.c

index 49442fb7bfc8d77f151e1004cfd98139c48a231a..521248bbcdece7000e080836056178c7c20367a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-30  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/commands/gptsync.c (grub_cmd_gptsync): Propagate the
+       relaxation of protective MBR requirements.
+
 2012-05-29  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * configure.ac: Add condition for COND_HOST_XNU.
index fbfcea05c1e85bffe096e5f4de6650d29913e4e7..1a203dc59d2fa70c23c62ba3b61d77eca83412e5 100644 (file)
@@ -67,6 +67,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
   struct grub_partition *partition;
   grub_disk_addr_t first_sector;
   int numactive = 0;
+  int i;
 
   if (argc < 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");
@@ -107,13 +108,15 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
     }
 
   /* Make sure the MBR is a protective MBR and not a normal MBR.  */
-  if (mbr.entries[0].type != GRUB_PC_PARTITION_TYPE_GPT_DISK)
+  for (i = 0; i < 4; i++)
+    if (mbr.entries[i].type == GRUB_PC_PARTITION_TYPE_GPT_DISK)
+      break;
+  if (i == 4)
     {
       grub_device_close (dev);
       return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found");
     }
 
-  int i;
   first_sector = dev->disk->total_sectors;
   for (i = 1; i < argc; i++)
     {