]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Eot/Eot.py
BaseTools: Eot - Remove FvImage file
[mirror_edk2.git] / BaseTools / Source / Python / Eot / Eot.py
index 029caedabcf4f8f085e376dda02d487729473e14..15de822d69c279addd5ef19ecee6b0714e0912aa 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to be the main entrance of EOT tool\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os, time, glob\r
+import Common.LongFilePathOs as os, time, glob\r
 import Common.EdkLogger as EdkLogger\r
 import EotGlobalData\r
 from optparse import OptionParser\r
@@ -24,12 +24,34 @@ from Common.Misc import GuidStructureStringToGuidString
 from InfParserLite import *\r
 import c\r
 import Database\r
-from FvImage import *\r
 from array import array\r
 from Report import Report\r
-from Common.Misc import ParseConsoleLog\r
 from Common.BuildVersion import gBUILD_VERSION\r
 from Parser import ConvertGuid\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
+\r
+## MultipleFv() class\r
+#\r
+#  A class for Multiple FV\r
+#\r
+class MultipleFv(FirmwareVolume):\r
+    def __init__(self, FvList):\r
+        FirmwareVolume.__init__(self)\r
+        self.BasicInfo = []\r
+        for FvPath in FvList:\r
+            FvName = os.path.splitext(os.path.split(FvPath)[1])[0]\r
+            Fd = open(FvPath, 'rb')\r
+            Buf = array('B')\r
+            try:\r
+                Buf.fromfile(Fd, os.path.getsize(FvPath))\r
+            except EOFError:\r
+                pass\r
+\r
+            Fv = FirmwareVolume(FvName)\r
+            Fv.frombuffer(Buf, 0, len(Buf))\r
+\r
+            self.BasicInfo.append([Fv.Name, Fv.FileSystemGuid, Fv.Size])\r
+            self.FfsDict.append(Fv.FfsDict)    \r
 \r
 ## Class Eot\r
 #\r
@@ -339,14 +361,6 @@ class Eot(object):
             GuidMacro2 = ''\r
             GuidValue = ''\r
 \r
-            # Find value for hardcode guid macro\r
-            if GuidName in EotGlobalData.gGuidMacroDict:\r
-                GuidMacro = EotGlobalData.gGuidMacroDict[GuidName][0]\r
-                GuidValue = EotGlobalData.gGuidMacroDict[GuidName][1]\r
-                SqlCommand = """update Report set GuidMacro = '%s', GuidValue = '%s' where GuidName = '%s'""" %(GuidMacro, GuidValue, GuidName)\r
-                EotGlobalData.gDb.TblReport.Exec(SqlCommand)\r
-                continue\r
-\r
             # Find guid value defined in Dec file\r
             if GuidName in EotGlobalData.gGuidDict:\r
                 GuidValue = EotGlobalData.gGuidDict[GuidName]\r
@@ -578,11 +592,11 @@ class Eot(object):
     #  @param Option: The option list including log level setting\r
     #\r
     def SetLogLevel(self, Option):\r
-        if Option.verbose != None:\r
+        if Option.verbose is not None:\r
             EdkLogger.SetLevel(EdkLogger.VERBOSE)\r
-        elif Option.quiet != None:\r
+        elif Option.quiet is not None:\r
             EdkLogger.SetLevel(EdkLogger.QUIET)\r
-        elif Option.debug != None:\r
+        elif Option.debug is not None:\r
             EdkLogger.SetLevel(Option.debug + 1)\r
         else:\r
             EdkLogger.SetLevel(EdkLogger.INFO)\r