# @retval tuple (Generated file name list, section alignment)\r
#\r
def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}, IsMakefile = False) :\r
- \r
+\r
if self.FileName is not None and self.FileName.startswith('PCD('):\r
self.FileName = GenFdsGlobalVariable.GetPcdValue(self.FileName)\r
"""Prepare the parameter of GenSection"""\r
StringData = FfsInf.__ExtendMacro__(self.StringData)\r
ModuleNameStr = FfsInf.__ExtendMacro__('$(MODULE_NAME)')\r
NoStrip = True\r
- if FfsInf.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM) and SectionType in ('TE', 'PE32'):\r
+ if FfsInf.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM) and SectionType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):\r
if FfsInf.KeepReloc is not None:\r
NoStrip = FfsInf.KeepReloc\r
elif FfsInf.KeepRelocFromRule is not None:\r
elif FileList != []:\r
for File in FileList:\r
Index = Index + 1\r
- Num = '%s.%d' %(SecNum , Index)\r
+ Num = '%s.%d' %(SecNum, Index)\r
OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))\r
f = open(File, 'r')\r
VerString = f.read()\r
BuildNumTuple = tuple()\r
BuildNumString = ' ' + ' '.join(BuildNumTuple)\r
\r
- #if VerString == '' and \r
+ #if VerString == '' and\r
if BuildNumString == '':\r
if self.Optional == True :\r
GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")\r
OutputFileList.append(OutputFile)\r
\r
#\r
- # If Section Type is 'UI'\r
+ # If Section Type is BINARY_FILE_TYPE_UI\r
#\r
- elif SectionType == 'UI':\r
+ elif SectionType == BINARY_FILE_TYPE_UI:\r
\r
InfOverrideUiString = False\r
if FfsInf.Ui is not None:\r
elif FileList != []:\r
for File in FileList:\r
Index = Index + 1\r
- Num = '%s.%d' %(SecNum , Index)\r
+ Num = '%s.%d' %(SecNum, Index)\r
OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))\r
f = open(File, 'r')\r
UiString = f.read()\r
for File in FileList:\r
""" Copy Map file to FFS output path """\r
Index = Index + 1\r
- Num = '%s.%d' %(SecNum , Index)\r
+ Num = '%s.%d' %(SecNum, Index)\r
OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))\r
File = GenFdsGlobalVariable.MacroExtend(File, Dict)\r
- \r
+\r
#Get PE Section alignment when align is set to AUTO\r
- if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):\r
+ if self.Alignment == 'Auto' and (SectionType == BINARY_FILE_TYPE_PE32 or SectionType == BINARY_FILE_TYPE_TE):\r
ImageObj = PeImageClass (File)\r
if ImageObj.SectionAlignment < 0x400:\r
Align = str (ImageObj.SectionAlignment)\r
IsMakefile = IsMakefile\r
)\r
File = StrippedFile\r
- \r
+\r
"""For TE Section call GenFw to generate TE image"""\r
\r
- if SectionType == 'TE':\r
+ if SectionType == BINARY_FILE_TYPE_TE:\r
TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')\r
GenFdsGlobalVariable.GenerateFirmwareImage(\r
TeFile,\r