- if FmpKeyList:\r
- raise Warning("Missing keywords %s in FMP payload section" % ', '.join(FmpKeyList), self.FileName, self.CurrentLineNumber)\r
- ImageFile = self.__ParseRawFileStatement()\r
- if not ImageFile:\r
- raise Warning("Missing image file in FMP payload section", self.FileName, self.CurrentLineNumber)\r
- FmpData.ImageFile = ImageFile\r
- VendorCodeFile = self.__ParseRawFileStatement()\r
- if VendorCodeFile:\r
- FmpData.VendorCodeFile = VendorCodeFile\r
+ if (FmpData.MonotonicCount and not FmpData.Certificate_Guid) or (not FmpData.MonotonicCount and FmpData.Certificate_Guid):\r
+ EdkLogger.error("FdfParser", FORMAT_INVALID, "CERTIFICATE_GUID and MONOTONIC_COUNT must be work as a pair.")\r
+\r
+ # Only the IMAGE_TYPE_ID is required item\r
+ if FmpKeyList and 'IMAGE_TYPE_ID' in FmpKeyList:\r
+ raise Warning("Missing keywords IMAGE_TYPE_ID in FMP payload section.", self.FileName, self.CurrentLineNumber)\r
+ # get the Image file and Vendor code file\r
+ self.__GetFMPCapsuleData(FmpData)\r
+ if not FmpData.ImageFile:\r
+ raise Warning("Missing image file in FMP payload section.", self.FileName, self.CurrentLineNumber)\r
+ # check whether more than one Vendor code file\r
+ if len(FmpData.VendorCodeFile) > 1:\r
+ raise Warning("At most one Image file and one Vendor code file are allowed in FMP payload section.", self.FileName, self.CurrentLineNumber)\r