- for FileName in FileList:\r
- OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get("FV_IMAGE"))\r
- GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE')\r
+ MaxFvAlignment = 0\r
+ for FvFileName in FileList:\r
+ FvAlignmentValue = 0\r
+ if os.path.isfile(FvFileName):\r
+ FvFileObj = open (FvFileName,'rb')\r
+ FvFileObj.seek(0)\r
+ # PI FvHeader is 0x48 byte\r
+ FvHeaderBuffer = FvFileObj.read(0x48)\r
+ # FV alignment position.\r
+ FvAlignmentValue = 1 << (ord (FvHeaderBuffer[0x2E]) & 0x1F)\r
+ FvFileObj.close()\r
+ if FvAlignmentValue > MaxFvAlignment:\r
+ MaxFvAlignment = FvAlignmentValue\r
+\r
+ OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get("FV_IMAGE"))\r
+ GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE', IsMakefile=IsMakefile)\r