]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/CapsuleData.py
BaseTools: use set instead of list for a variable to be used with in
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / CapsuleData.py
index 07cc1981d6e92ab5ef212eee8f25e30df60f73a3..5b806d9e44825a6a1a4d20cd05cbc365f9e73004 100644 (file)
@@ -1,7 +1,7 @@
 ## @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
@@ -179,14 +179,20 @@ class CapsulePayload(CapsuleData):
         self.ImageTypeId = None\r
         self.ImageIndex = None\r
         self.HardwareInstance = None\r
-        self.ImageFile = None\r
-        self.VendorCodeFile = None\r
+        self.ImageFile = []\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
-            self.Version = 0x00000002\r
+            self.Version = '0x00000002'\r
+        if not self.ImageIndex:\r
+            self.ImageIndex = '0x1'\r
+        if not self.HardwareInstance:\r
+            self.HardwareInstance = '0x0'\r
         ImageFileSize = os.path.getsize(self.ImageFile)\r
         if AuthData:\r
             # the ImageFileSize need include the full authenticated info size. From first bytes of MonotonicCount to last bytes of certificate.\r
@@ -235,4 +241,5 @@ class CapsulePayload(CapsuleData):
             VendorFile = open(self.VendorCodeFile, 'rb')\r
             Buffer += VendorFile.read()\r
             VendorFile.close()\r
+        self.Existed = True\r
         return Buffer\r