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 <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Fan, ZhijuX
2019-05-29 13:29:34 +08:00
committed by Feng, Bob C
parent 6cbed0e36f
commit 04797875d1
5 changed files with 46 additions and 7 deletions

View File

@ -93,7 +93,7 @@ class EfiSection (EfiSectionClassObject):
if '.depex' in SuffixMap:
FileList.append(Filename)
else:
FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile)
FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile, SectionType=SectionType)
if IsSect :
return FileList, self.Alignment
@ -217,6 +217,26 @@ class EfiSection (EfiSectionClassObject):
Ui=StringData, IsMakefile=IsMakefile)
OutputFileList.append(OutputFile)
#
# If Section Type is BINARY_FILE_TYPE_RAW
#
elif SectionType == BINARY_FILE_TYPE_RAW:
"""If File List is empty"""
if FileList == []:
if self.Optional == True:
GenFdsGlobalVariable.VerboseLogger("Optional Section don't exist!")
return [], None
else:
EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for %s section could not be found for %s" % (SectionType, InfFileName))
elif len(FileList) > 1:
EdkLogger.error("GenFds", GENFDS_ERROR,
"Files suffixed with %s are not allowed to have more than one file in %s[Binaries] section" % (
self.FileExtension, InfFileName))
else:
for File in FileList:
File = GenFdsGlobalVariable.MacroExtend(File, Dict)
OutputFileList.append(File)
else:
"""If File List is empty"""