summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Disk
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-14 05:39:12 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-14 05:39:12 +0000
commit339c754a01faee83421c52b8a2ce9e80b9904e7e (patch)
tree439674d7a9ec25b14e86c15115a576d740fbfde7 /MdeModulePkg/Universal/Disk
parent737dfc361211ac91b7465fccbbf5fbeff1ed5466 (diff)
downloadedk2-339c754a01faee83421c52b8a2ce9e80b9904e7e.zip
edk2-339c754a01faee83421c52b8a2ce9e80b9904e7e.tar.gz
edk2-339c754a01faee83421c52b8a2ce9e80b9904e7e.tar.bz2
Enhance GPT to remove the assumption that GPT partition entry in PMBR must be the first partition entry.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9069 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Disk')
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
index c7d74ea..7bcfe69 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
@@ -2,7 +2,7 @@
Decode a hard disk partitioned with the GPT scheme in the UEFI 2.0
specification.
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>
+Copyright (c) 2006 - 2009, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -231,10 +231,15 @@ PartitionInstallGptChildHandles (
//
// Verify that the Protective MBR is valid
//
- if (ProtectiveMbr->Partition[0].BootIndicator != 0x00 ||
- ProtectiveMbr->Partition[0].OSIndicator != PMBR_GPT_PARTITION ||
- UNPACK_UINT32 (ProtectiveMbr->Partition[0].StartingLBA) != 1
- ) {
+ for (Index = 0; Index < MAX_MBR_PARTITIONS; Index++) {
+ if (ProtectiveMbr->Partition[Index].BootIndicator == 0x00 &&
+ ProtectiveMbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION &&
+ UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) == 1
+ ) {
+ break;
+ }
+ }
+ if (Index == MAX_MBR_PARTITIONS) {
goto Done;
}