From 04797875d1d53e53e31eca4fa01bc3cf6929f39c Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Wed, 29 May 2019 13:29:34 +0800 Subject: BaseTools:Make BaseTools support new rules to generate RAW FFS FILE BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1765 If RAW FFS File Rule has no section for its data.For RAW FFS File, directly call GenFfs tool to generate FFS file. Ffs Rule: [Rule.Common.USER_DEFINED.MicroCode] FILE RAW = $(NAMED_GUID) { $(INF_OUTPUT)/$(MODULE_NAME).bin } [Rule.Common.USER_DEFINED.LOGO] FILE RAW = $(NAMED_GUID) { |.bmp } As shown in the rule above,if SectionType and FileType not defined, FFS files are generated directly, and no other type of file is generated. The patch is to make the BaseTools support these two rules Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/FfsInfStatement.py') diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 78dd7cd51a..cd3b0f6477 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -147,7 +147,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param self The object pointer # @param Dict dictionary contains macro and value pair # - def __InfParse__(self, Dict = {}): + def __InfParse__(self, Dict = None, IsGenFfs=False): GenFdsGlobalVariable.VerboseLogger( " Begine parsing INf file : %s" %self.InfFileName) @@ -348,7 +348,10 @@ class FfsInfStatement(FfsInfStatementClassObject): # # Set OutputPath = ${WorkSpace}\Build\Fv\Ffs\${ModuleGuid}+ ${ModuleName}\ # - + if IsGenFfs: + Rule = self.__GetRule__() + if GlobalData.gGuidPatternEnd.match(Rule.NameGuid): + self.ModuleGuid = Rule.NameGuid self.OutputPath = os.path.join(GenFdsGlobalVariable.FfsDir, \ self.ModuleGuid + self.BaseName) if not os.path.exists(self.OutputPath) : @@ -438,7 +441,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # Parse Inf file get Module related information # - self.__InfParse__(Dict) + self.__InfParse__(Dict, IsGenFfs=True) Arch = self.GetCurrentArch() SrcFile = mws.join( GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName); DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs') -- cgit v1.2.3