+ elif self.FileName is not None:\r
+ if hasattr(self, 'FvFileType') and self.FvFileType == 'RAW':\r
+ if isinstance(self.FileName, list) and isinstance(self.SubAlignment, list) and len(self.FileName) == len(self.SubAlignment):\r
+ FileContent = ''\r
+ MaxAlignIndex = 0\r
+ MaxAlignValue = 1\r
+ for Index, File in enumerate(self.FileName):\r
+ try:\r
+ f = open(File, 'rb')\r
+ except:\r
+ GenFdsGlobalVariable.ErrorLogger("Error opening RAW file %s." % (File))\r
+ Content = f.read()\r
+ f.close()\r
+ AlignValue = 1\r
+ if self.SubAlignment[Index] is not None:\r
+ AlignValue = GenFdsGlobalVariable.GetAlignment(self.SubAlignment[Index])\r
+ if AlignValue > MaxAlignValue:\r
+ MaxAlignIndex = Index\r
+ MaxAlignValue = AlignValue\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, self.NameGuid, self.NameGuid + '.raw')\r
+ SaveFileOnChange(OutputRAWFile, FileContent, True)\r
+ self.FileName = OutputRAWFile\r
+ self.SubAlignment = self.SubAlignment[MaxAlignIndex]\r
+\r
+ if self.Alignment and self.SubAlignment:\r
+ if GenFdsGlobalVariable.GetAlignment (self.Alignment) < GenFdsGlobalVariable.GetAlignment (self.SubAlignment):\r
+ self.Alignment = self.SubAlignment\r
+ elif self.SubAlignment:\r
+ self.Alignment = self.SubAlignment\r
+\r