summaryrefslogtreecommitdiffstats
path: root/block/partitions/efi.h
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr@hp.com>2013-09-11 14:24:58 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 15:59:16 -0700
commitb05ebbbbeb67a420d06567c6b9618a9e644d6104 (patch)
treec8191dab1a7a18752afbb4158e1ad988fbfc0779 /block/partitions/efi.h
parent3e69ac344007bec5e3987ac86619e140fbc79b72 (diff)
downloadlinux-stable-b05ebbbbeb67a420d06567c6b9618a9e644d6104.tar.gz
linux-stable-b05ebbbbeb67a420d06567c6b9618a9e644d6104.tar.bz2
linux-stable-b05ebbbbeb67a420d06567c6b9618a9e644d6104.zip
partitions/efi: detect hybrid MBRs
One of the biggest problems with GPT is compatibility with older, non-GPT systems. The problem is addressed by creating hybrid mbrs, an extension, or variant, of the traditional protective mbr. This contains, apart from the 0xEE partition, up three additional primary partitions that point to the same space marked by up to three GPT partitions. The result is that legacy OSs can see the three required MBR partitions and at the same time ignore the GPT-aware partitions that protect the GPT structures. While hybrid MBRs are hacks, workarounds and simply not part of the GPT standard, they do exist and we have no way around them. For instance, by default, OSX creates a hybrid scheme when using multi-OS booting. In order for Linux to properly discover protective MBRs, it must be made aware of devices that have hybrid MBRs. No functionality is changed by this patch, just a debug message informing the user of the MBR scheme that is being used. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Reviewed-by: Karel Zak <kzak@redhat.com> Acked-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block/partitions/efi.h')
-rw-r--r--block/partitions/efi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/partitions/efi.h b/block/partitions/efi.h
index e645ecb35bf3..7fef625c04de 100644
--- a/block/partitions/efi.h
+++ b/block/partitions/efi.h
@@ -37,6 +37,9 @@
#define EFI_PMBR_OSTYPE_EFI 0xEF
#define EFI_PMBR_OSTYPE_EFI_GPT 0xEE
+#define GPT_MBR_PROTECTIVE 1
+#define GPT_MBR_HYBRID 2
+
#define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
#define GPT_HEADER_REVISION_V1 0x00010000
#define GPT_PRIMARY_PARTITION_TABLE_LBA 1