]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools: fix imports
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FfsInfStatement.py
index 43b9c90b776a28fb9103f5494331f71bbf6459f5..4dda3cf787e13980537f377d90abbe2dd37f9bb0 100644 (file)
 ##\r
 # Import Modules\r
 #\r
+from __future__ import absolute_import\r
 from . import Rule\r
 import Common.LongFilePathOs as os\r
 from io import BytesIO\r
 from struct import *\r
 from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
-from . import Ffs\r
+from .Ffs import SectionSuffix,FdfFvFileTypeToFileType\r
 import subprocess\r
 import sys\r
 from . import Section\r
@@ -29,6 +30,7 @@ from . import RuleSimpleFile
 from . import RuleComplexFile\r
 from CommonDataClass.FdfClass import FfsInfStatementClassObject\r
 from Common.MultipleWorkspace import MultipleWorkspace as mws\r
+from Common.DataType import SUP_MODULE_USER_DEFINED\r
 from Common.StringUtils import *\r
 from Common.Misc import PathClass\r
 from Common.Misc import GuidStructureByteArrayToGuidString\r
@@ -93,7 +95,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 ModuleType = self.InfModule.ModuleType\r
                 PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
 \r
-                if ModuleType != DataType.SUP_MODULE_USER_DEFINED:\r
+                if ModuleType != SUP_MODULE_USER_DEFINED:\r
                     for LibraryClass in PlatformDataBase.LibraryClasses.GetKeys():\r
                         if LibraryClass.startswith("NULL") and PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]:\r
                             self.InfModule.LibraryClasses[LibraryClass] = PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]\r
@@ -759,7 +761,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
 \r
                 SecNum = '%d' %Index\r
                 GenSecOutputFile= self.__ExtendMacro__(Rule.NameGuid) + \\r
-                              Ffs.Ffs.SectionSuffix[SectionType] + SUP_MODULE_SEC + SecNum\r
+                              SectionSuffix[SectionType] + SUP_MODULE_SEC + SecNum\r
                 Index = Index + 1\r
                 OutputFile = os.path.join(self.OutputPath, GenSecOutputFile)\r
                 File = GenFdsGlobalVariable.MacroExtend(File, Dict, self.CurrentArch)\r
@@ -802,7 +804,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         else:\r
             SecNum = '%d' %Index\r
             GenSecOutputFile= self.__ExtendMacro__(Rule.NameGuid) + \\r
-                              Ffs.Ffs.SectionSuffix[SectionType] + SUP_MODULE_SEC + SecNum\r
+                              SectionSuffix[SectionType] + SUP_MODULE_SEC + SecNum\r
             OutputFile = os.path.join(self.OutputPath, GenSecOutputFile)\r
             GenSecInputFile = GenFdsGlobalVariable.MacroExtend(GenSecInputFile, Dict, self.CurrentArch)\r
 \r
@@ -881,7 +883,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
             self.ModuleGuid = RegistryGuidStr\r
 \r
             GenFdsGlobalVariable.GenerateFfs(FfsOutput, InputSection,\r
-                                             Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType],\r
+                                             FdfFvFileTypeToFileType[Rule.FvFileType],\r
                                              self.ModuleGuid, Fixed=Rule.Fixed,\r
                                              CheckSum=Rule.CheckSum, Align=Rule.Alignment,\r
                                              SectionAlign=SectionAlignments,\r
@@ -900,7 +902,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #   @retval string       File name of the generated section file\r
     #\r
     def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr, IsMakefile = False):\r
-        if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM):\r
+        if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM, SUP_MODULE_MM_CORE_STANDALONE):\r
             if Rule.KeepReloc is not None:\r
                 self.KeepRelocFromRule = Rule.KeepReloc\r
         SectFiles = []\r
@@ -1054,7 +1056,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
 \r
         FfsOutput = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')\r
         GenFdsGlobalVariable.GenerateFfs(FfsOutput, InputFile,\r
-                                             Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType],\r
+                                             FdfFvFileTypeToFileType[Rule.FvFileType],\r
                                              self.ModuleGuid, Fixed=Rule.Fixed,\r
                                              CheckSum=Rule.CheckSum, Align=Rule.Alignment,\r
                                              SectionAlign=Alignments,\r