BINARY_FILE_TYPE_UI = 'UI'\r
BINARY_FILE_TYPE_BIN = 'BIN'\r
BINARY_FILE_TYPE_FV = 'FV'\r
+BINARY_FILE_TYPE_RAW = 'RAW_BINARY'\r
\r
PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS = 'LIBRARY_CLASS'\r
PLATFORM_COMPONENT_TYPE_MODULE = 'MODULE'\r
if '.depex' in SuffixMap:\r
FileList.append(Filename)\r
else:\r
- FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile)\r
+ FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile, SectionType=SectionType)\r
if IsSect :\r
return FileList, self.Alignment\r
\r
Ui=StringData, IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
+ #\r
+ # If Section Type is BINARY_FILE_TYPE_RAW\r
+ #\r
+ elif SectionType == BINARY_FILE_TYPE_RAW:\r
+ """If File List is empty"""\r
+ if FileList == []:\r
+ if self.Optional == True:\r
+ GenFdsGlobalVariable.VerboseLogger("Optional Section don't exist!")\r
+ return [], None\r
+ else:\r
+ EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for %s section could not be found for %s" % (SectionType, InfFileName))\r
+\r
+ elif len(FileList) > 1:\r
+ EdkLogger.error("GenFds", GENFDS_ERROR,\r
+ "Files suffixed with %s are not allowed to have more than one file in %s[Binaries] section" % (\r
+ self.FileExtension, InfFileName))\r
+ else:\r
+ for File in FileList:\r
+ File = GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+ OutputFileList.append(File)\r
\r
else:\r
"""If File List is empty"""\r
#\r
def _GetEfiSection(self, Obj):\r
OldPos = self.GetFileBufferPos()\r
+ EfiSectionObj = EfiSection()\r
if not self._GetNextWord():\r
- return False\r
+ CurrentLine = self._CurrentLine()[self.CurrentOffsetWithinLine:].split()[0].strip()\r
+ if self._Token == '{' and Obj.FvFileType == "RAW" and TAB_SPLIT in CurrentLine:\r
+ if self._IsToken(TAB_VALUE_SPLIT):\r
+ EfiSectionObj.FileExtension = self._GetFileExtension()\r
+ elif self._GetNextToken():\r
+ EfiSectionObj.FileName = self._Token\r
+ EfiSectionObj.SectionType = BINARY_FILE_TYPE_RAW\r
+ Obj.SectionList.append(EfiSectionObj)\r
+ return True\r
+ else:\r
+ return False\r
SectionName = self._Token\r
\r
if SectionName not in {\r
Obj.SectionList.append(FvImageSectionObj)\r
return True\r
\r
- EfiSectionObj = EfiSection()\r
EfiSectionObj.SectionType = SectionName\r
\r
if not self._GetNextToken():\r
# @param self The object pointer\r
# @param Dict dictionary contains macro and value pair\r
#\r
- def __InfParse__(self, Dict = {}):\r
+ def __InfParse__(self, Dict = None, IsGenFfs=False):\r
\r
GenFdsGlobalVariable.VerboseLogger( " Begine parsing INf file : %s" %self.InfFileName)\r
\r
#\r
# Set OutputPath = ${WorkSpace}\Build\Fv\Ffs\${ModuleGuid}+ ${ModuleName}\\r
#\r
-\r
+ if IsGenFfs:\r
+ Rule = self.__GetRule__()\r
+ if GlobalData.gGuidPatternEnd.match(Rule.NameGuid):\r
+ self.ModuleGuid = Rule.NameGuid\r
self.OutputPath = os.path.join(GenFdsGlobalVariable.FfsDir, \\r
self.ModuleGuid + self.BaseName)\r
if not os.path.exists(self.OutputPath) :\r
# Parse Inf file get Module related information\r
#\r
\r
- self.__InfParse__(Dict)\r
+ self.__InfParse__(Dict, IsGenFfs=True)\r
Arch = self.GetCurrentArch()\r
SrcFile = mws.join( GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName);\r
DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')\r
# @param Dict dictionary contains macro and its value\r
# @retval tuple (File list, boolean)\r
#\r
- def GetFileList(FfsInf, FileType, FileExtension, Dict = {}, IsMakefile=False):\r
+ def GetFileList(FfsInf, FileType, FileExtension, Dict = None, IsMakefile=False, SectionType=None):\r
IsSect = FileType in Section.SectFileType\r
\r
if FileExtension is not None:\r
else:\r
GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))\r
\r
+ elif FileType is None and SectionType == BINARY_FILE_TYPE_RAW:\r
+ for File in FfsInf.BinFileList:\r
+ if File.Ext == Suffix:\r
+ FileList.append(File.Path)\r
+\r
if (not IsMakefile and Suffix is not None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not None):\r
#\r
# Get Makefile path and time stamp\r