Index: pc.c =================================================================== --- pc.c (revision 1861) +++ pc.c (working copy) @@ -19,11 +19,17 @@ #include #include +#include #include #include #include #include +static grub_uint8_t grub_gpt_magic[8] = + { + 0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54 + }; + static struct grub_partition_map grub_pc_partition_map; #ifndef GRUB_UTIL @@ -111,6 +117,13 @@ pcdata.dos_part = -1; p.data = &pcdata; p.partmap = &grub_pc_partition_map; + + /* Read the GPT header. */ + if (grub_disk_read (&raw, 1, 0, sizeof (gpt), (char *) &gpt)) + return grub_errno; + + if (!grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic))) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "valid GPT header"); while (1) { Index: gpt.c =================================================================== --- gpt.c (revision 1861) +++ gpt.c (working copy) @@ -58,18 +58,6 @@ raw = *disk; raw.partition = 0; - /* Read the protective MBR. */ - if (grub_disk_read (&raw, 0, 0, sizeof (mbr), (char *) &mbr)) - return grub_errno; - - /* Check if it is valid. */ - if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); - - /* Make sure the MBR is a protective MBR and not a normal MBR. */ - if (mbr.entries[0].type != GRUB_PC_PARTITION_TYPE_GPT_DISK) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found"); - /* Read the GPT header. */ if (grub_disk_read (&raw, 1, 0, sizeof (gpt), (char *) &gpt)) return grub_errno;