]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/FwVol/FwVol.c
MdeModulePkg PeiCore: Make sure FvInfo has FFS2 format if Ffs2Guid FvFormat
[mirror_edk2.git] / MdeModulePkg / Core / Pei / FwVol / FwVol.c
index d2eb0bc35b6250845f0c78044471d207cacd12e2..8d07bd0747ef26b31f43ba4e21a08c528ca47cef 100644 (file)
@@ -565,6 +565,20 @@ FirmwareVolmeInfoPpiNotifyCallback (
     IsFvInfo2 = FALSE;\r
   }\r
 \r
     IsFvInfo2 = FALSE;\r
   }\r
 \r
+  if (CompareGuid (&FvInfo2Ppi.FvFormat, &gEfiFirmwareFileSystem2Guid)) {\r
+    //\r
+    // gEfiFirmwareFileSystem2Guid is specified for FvFormat, then here to check the\r
+    // FileSystemGuid pointed by FvInfo against gEfiFirmwareFileSystem2Guid to make sure\r
+    // FvInfo has the firmware file system 2 format.\r
+    //\r
+    // If the ASSERT really appears, FvFormat needs to be specified correctly, for example,\r
+    // gEfiFirmwareFileSystem3Guid can be used for firmware file system 3 format, or\r
+    // ((EFI_FIRMWARE_VOLUME_HEADER *) FvInfo)->FileSystemGuid can be just used for both\r
+    // firmware file system 2 and 3 format.\r
+    //\r
+    ASSERT (CompareGuid (&(((EFI_FIRMWARE_VOLUME_HEADER *) FvInfo2Ppi.FvInfo)->FileSystemGuid), &gEfiFirmwareFileSystem2Guid));\r
+  }\r
+\r
   //\r
   // Locate the corresponding FV_PPI according to founded FV's format guid\r
   //\r
   //\r
   // Locate the corresponding FV_PPI according to founded FV's format guid\r
   //\r