diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-27 00:57:56 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-02 15:01:43 +0800 |
commit | 91fa33eeca8cea64490ccf4d92f920369a2a3eed (patch) | |
tree | 2cf6683a4720d51ba3d2c37117495a362b4d94b7 /BaseTools/Source/Python/GenFds/FfsInfStatement.py | |
parent | be409b67566348f75b69e66ef9604b248e053553 (diff) | |
download | edk2-91fa33eeca8cea64490ccf4d92f920369a2a3eed.tar.gz edk2-91fa33eeca8cea64490ccf4d92f920369a2a3eed.tar.bz2 edk2-91fa33eeca8cea64490ccf4d92f920369a2a3eed.zip |
BaseTools: Replace Binary File type strings with predefined constant
BINARY_FILE_TYPE_FW was 'FW'
BINARY_FILE_TYPE_GUID was 'GUID'
BINARY_FILE_TYPE_PREEFORM was 'PREEFORM'
BINARY_FILE_TYPE_UEFI_APP was 'UEFI_APP'
BINARY_FILE_TYPE_UNI_UI was 'UNI_UI'
BINARY_FILE_TYPE_UNI_VER was 'UNI_VER'
BINARY_FILE_TYPE_LIB was 'LIB'
BINARY_FILE_TYPE_PE32 was 'PE32'
BINARY_FILE_TYPE_PIC was 'PIC'
BINARY_FILE_TYPE_PEI_DEPEX was 'PEI_DEPEX'
BINARY_FILE_TYPE_DXE_DEPEX was 'DXE_DEPEX'
BINARY_FILE_TYPE_SMM_DEPEX was 'SMM_DEPEX'
BINARY_FILE_TYPE_TE was 'TE'
BINARY_FILE_TYPE_VER was 'VER'
BINARY_FILE_TYPE_UI was 'UI'
BINARY_FILE_TYPE_BIN was 'BIN'
BINARY_FILE_TYPE_FV was 'FV'
v2 - split apart FV and GUID types with different meanings.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FfsInfStatement.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FfsInfStatement.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 9068157ba6..728997f17d 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -381,7 +381,7 @@ class FfsInfStatement(FfsInfStatementClassObject): #
# Only patch file if FileType is PE32 or ModuleType is USER_DEFINED
#
- if FileType != 'PE32' and self.ModuleType != SUP_MODULE_USER_DEFINED:
+ if FileType != BINARY_FILE_TYPE_PE32 and self.ModuleType != SUP_MODULE_USER_DEFINED:
return EfiFile
#
@@ -739,13 +739,13 @@ class FfsInfStatement(FfsInfStatementClassObject): # Convert Fv Section Type for PI1.1 SMM driver.
#
if self.ModuleType == SUP_MODULE_DXE_SMM_DRIVER and int(self.PiSpecVersion, 16) >= 0x0001000A:
- if SectionType == 'DXE_DEPEX':
- SectionType = 'SMM_DEPEX'
+ if SectionType == BINARY_FILE_TYPE_DXE_DEPEX:
+ SectionType = BINARY_FILE_TYPE_SMM_DEPEX
#
# Framework SMM Driver has no SMM_DEPEX section type
#
if self.ModuleType == SUP_MODULE_DXE_SMM_DRIVER and int(self.PiSpecVersion, 16) < 0x0001000A:
- if SectionType == 'SMM_DEPEX':
+ if SectionType == BINARY_FILE_TYPE_SMM_DEPEX:
EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)
NoStrip = True
if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM):
@@ -767,7 +767,7 @@ class FfsInfStatement(FfsInfStatementClassObject): File = GenFdsGlobalVariable.MacroExtend(File, Dict, self.CurrentArch)
#Get PE Section alignment when align is set to AUTO
- if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):
+ if self.Alignment == 'Auto' and (SectionType == BINARY_FILE_TYPE_PE32 or SectionType == BINARY_FILE_TYPE_TE):
ImageObj = PeImageClass (File)
if ImageObj.SectionAlignment < 0x400:
self.Alignment = str (ImageObj.SectionAlignment)
@@ -790,7 +790,7 @@ class FfsInfStatement(FfsInfStatementClassObject): )
File = StrippedFile
- if SectionType == 'TE':
+ if SectionType == BINARY_FILE_TYPE_TE:
TeFile = os.path.join( self.OutputPath, self.ModuleGuid + 'Te.raw')
GenFdsGlobalVariable.GenerateFirmwareImage(
TeFile,
@@ -809,7 +809,7 @@ class FfsInfStatement(FfsInfStatementClassObject): GenSecInputFile = GenFdsGlobalVariable.MacroExtend(GenSecInputFile, Dict, self.CurrentArch)
#Get PE Section alignment when align is set to AUTO
- if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):
+ if self.Alignment == 'Auto' and (SectionType == BINARY_FILE_TYPE_PE32 or SectionType == BINARY_FILE_TYPE_TE):
ImageObj = PeImageClass (GenSecInputFile)
if ImageObj.SectionAlignment < 0x400:
self.Alignment = str (ImageObj.SectionAlignment)
@@ -833,7 +833,7 @@ class FfsInfStatement(FfsInfStatementClassObject): )
GenSecInputFile = StrippedFile
- if SectionType == 'TE':
+ if SectionType == BINARY_FILE_TYPE_TE:
TeFile = os.path.join( self.OutputPath, self.ModuleGuid + 'Te.raw')
GenFdsGlobalVariable.GenerateFirmwareImage(
TeFile,
@@ -942,13 +942,13 @@ class FfsInfStatement(FfsInfStatementClassObject): # Convert Fv Section Type for PI1.1 SMM driver.
#
if self.ModuleType == SUP_MODULE_DXE_SMM_DRIVER and int(self.PiSpecVersion, 16) >= 0x0001000A:
- if Sect.SectionType == 'DXE_DEPEX':
- Sect.SectionType = 'SMM_DEPEX'
+ if Sect.SectionType == BINARY_FILE_TYPE_DXE_DEPEX:
+ Sect.SectionType = BINARY_FILE_TYPE_SMM_DEPEX
#
# Framework SMM Driver has no SMM_DEPEX section type
#
if self.ModuleType == SUP_MODULE_DXE_SMM_DRIVER and int(self.PiSpecVersion, 16) < 0x0001000A:
- if Sect.SectionType == 'SMM_DEPEX':
+ if Sect.SectionType == BINARY_FILE_TYPE_SMM_DEPEX:
EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)
#
# process the inside FvImage from FvSection or GuidSection
|