- if hasattr(FfsFile, 'FvFileType') and FfsFile.FvFileType == 'RAW':\r
- if isinstance(FfsFile.FileName, list) and isinstance(FfsFile.Alignment, list) and len(FfsFile.FileName) == len(FfsFile.Alignment):\r
- FileContent = ''\r
- for Index, File in enumerate(FfsFile.FileName):\r
- try:\r
- f = open(File, 'r+b')\r
- except:\r
- GenFdsGlobalVariable.ErrorLogger("Error opening RAW file %s." % (File))\r
- Content = f.read()\r
- f.close()\r
- AlignValue = FfsFile.Alignment[Index]\r
- if AlignValue == None:\r
- AlignValue = 1\r
- FileContent += Content\r
- if len(FileContent) % AlignValue != 0:\r
- Size = AlignValue - len(FileContent) % AlignValue\r
- for i in range(0, Size):\r
- FileContent += pack('B', 0xFF)\r
-\r
- if FileContent:\r
- OutputRAWFile = os.path.join(GenFdsGlobalVariable.FfsDir, FfsFile.NameGuid, FfsFile.NameGuid + '.raw')\r
- SaveFileOnChange(OutputRAWFile, FileContent, True)\r
- FfsFile.FileName = OutputRAWFile\r
- if max(FfsFile.Alignment):\r
- FfsFile.Alignment = str(max(FfsFile.Alignment))\r
- else:\r
- FfsFile.Alignment = None\r
-\r
- FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress)\r
+ if Flag:\r
+ if isinstance(FfsFile, FfsFileStatement.FileStatement):\r
+ continue\r
+ if GenFdsGlobalVariable.EnableGenfdsMultiThread and GenFdsGlobalVariable.ModuleFile and GenFdsGlobalVariable.ModuleFile.Path.find(os.path.normpath(FfsFile.InfFileName)) == -1:\r
+ continue\r
+ FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag, FvName=self.UiFvName)\r