## @file\r
# generate capsule\r
#\r
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
Content.write(File.read())\r
File.close()\r
for fmp in self.FmpPayloadList:\r
+ if fmp.Existed:\r
+ FwMgrHdr.write(pack('=Q', PreSize))\r
+ PreSize += len(fmp.Buffer)\r
+ Content.write(fmp.Buffer)\r
+ continue\r
if fmp.ImageFile:\r
for Obj in fmp.ImageFile:\r
fmp.ImageFile = Obj.GenCapsuleSubItem()\r
dwLength = 4 + 2 + 2 + 16 + 16 + 256 + 256\r
fmp.ImageFile = CapOutputTmp\r
AuthData = [fmp.MonotonicCount, dwLength, WIN_CERT_REVISION, WIN_CERT_TYPE_EFI_GUID, fmp.Certificate_Guid]\r
- Buffer = fmp.GenCapsuleSubItem(AuthData)\r
+ fmp.Buffer = fmp.GenCapsuleSubItem(AuthData)\r
else:\r
- Buffer = fmp.GenCapsuleSubItem()\r
+ fmp.Buffer = fmp.GenCapsuleSubItem()\r
FwMgrHdr.write(pack('=Q', PreSize))\r
- PreSize += len(Buffer)\r
- Content.write(Buffer)\r
+ PreSize += len(fmp.Buffer)\r
+ Content.write(fmp.Buffer)\r
BodySize = len(FwMgrHdr.getvalue()) + len(Content.getvalue())\r
Header.write(pack('=I', HdrSize + BodySize))\r
#\r
self.VendorCodeFile = []\r
self.Certificate_Guid = None\r
self.MonotonicCount = None\r
+ self.Existed = False\r
+ self.Buffer = None\r
\r
def GenCapsuleSubItem(self, AuthData=[]):\r
if not self.Version:\r
VendorFile = open(self.VendorCodeFile, 'rb')\r
Buffer += VendorFile.read()\r
VendorFile.close()\r
+ self.Existed = True\r
return Buffer\r