From 941e3a6d96ed11fa259ab94568bd8a978743305a Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 30 May 2012 13:51:50 +0200 Subject: [PATCH] * grub-core/commands/gptsync.c (grub_cmd_gptsync): Propagate the relaxation of protective MBR requirements. --- ChangeLog | 5 +++++ grub-core/commands/gptsync.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49442fb7b..521248bbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-30 Vladimir Serbinenko + + * grub-core/commands/gptsync.c (grub_cmd_gptsync): Propagate the + relaxation of protective MBR requirements. + 2012-05-29 Vladimir Serbinenko * configure.ac: Add condition for COND_HOST_XNU. diff --git a/grub-core/commands/gptsync.c b/grub-core/commands/gptsync.c index fbfcea05c..1a203dc59 100644 --- a/grub-core/commands/gptsync.c +++ b/grub-core/commands/gptsync.c @@ -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++) {