]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance GPT to remove the assumption that GPT partition entry in PMBR must be the...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 14 Aug 2009 05:39:12 +0000 (05:39 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 14 Aug 2009 05:39:12 +0000 (05:39 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9069 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c

index c7d74eadd8f0e937ce32b976f047970360339223..7bcfe697474e00e7f656d15fd73fea74b2a0e6a4 100644 (file)
@@ -2,7 +2,7 @@
   Decode a hard disk partitioned with the GPT scheme in the UEFI 2.0\r
   specification.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -231,10 +231,15 @@ PartitionInstallGptChildHandles (
   //\r
   // Verify that the Protective MBR is valid\r
   //\r
-  if (ProtectiveMbr->Partition[0].BootIndicator != 0x00 ||\r
-      ProtectiveMbr->Partition[0].OSIndicator != PMBR_GPT_PARTITION ||\r
-      UNPACK_UINT32 (ProtectiveMbr->Partition[0].StartingLBA) != 1\r
-      ) {\r
+  for (Index = 0; Index < MAX_MBR_PARTITIONS; Index++) {\r
+    if (ProtectiveMbr->Partition[Index].BootIndicator == 0x00 &&\r
+        ProtectiveMbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION &&\r
+        UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) == 1\r
+        ) {\r
+      break;\r
+    }\r
+  }\r
+  if (Index == MAX_MBR_PARTITIONS) {\r
     goto Done;\r
   }\r
 \r