BaseTool: correct the generate compress section process
First generate a dummy file with section alignment, then compress the dummy file to generate the compress file Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
committed by
Liming Gao
parent
582e4e449d
commit
ce2818e418
@ -60,6 +60,7 @@ class CompressSection (CompressSectionClassObject) :
|
|||||||
self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
|
self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
|
||||||
|
|
||||||
SectFiles = tuple()
|
SectFiles = tuple()
|
||||||
|
SectAlign = []
|
||||||
Index = 0
|
Index = 0
|
||||||
MaxAlign = None
|
MaxAlign = None
|
||||||
for Sect in self.SectionList:
|
for Sect in self.SectionList:
|
||||||
@ -76,13 +77,7 @@ class CompressSection (CompressSectionClassObject) :
|
|||||||
AlignValue = "1"
|
AlignValue = "1"
|
||||||
for FileData in ReturnSectList:
|
for FileData in ReturnSectList:
|
||||||
SectFiles += (FileData,)
|
SectFiles += (FileData,)
|
||||||
|
SectAlign.append(AlignValue)
|
||||||
if MaxAlign != None:
|
|
||||||
if self.Alignment == None:
|
|
||||||
self.Alignment = MaxAlign
|
|
||||||
else:
|
|
||||||
if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGlobalVariable.GetAlignment (self.Alignment):
|
|
||||||
self.Alignment = MaxAlign
|
|
||||||
|
|
||||||
OutputFile = OutputPath + \
|
OutputFile = OutputPath + \
|
||||||
os.sep + \
|
os.sep + \
|
||||||
@ -91,8 +86,10 @@ class CompressSection (CompressSectionClassObject) :
|
|||||||
SecNum + \
|
SecNum + \
|
||||||
Ffs.SectionSuffix['COMPRESS']
|
Ffs.SectionSuffix['COMPRESS']
|
||||||
OutputFile = os.path.normpath(OutputFile)
|
OutputFile = os.path.normpath(OutputFile)
|
||||||
|
DummyFile = OutputFile + '.dummy'
|
||||||
|
GenFdsGlobalVariable.GenerateSection(DummyFile, SectFiles, InputAlign=SectAlign, IsMakefile=IsMakefile)
|
||||||
|
|
||||||
GenFdsGlobalVariable.GenerateSection(OutputFile, SectFiles, Section.Section.SectionType['COMPRESS'],
|
GenFdsGlobalVariable.GenerateSection(OutputFile, [DummyFile], Section.Section.SectionType['COMPRESS'],
|
||||||
CompressionType=self.CompTypeDict[self.CompType], IsMakefile=IsMakefile)
|
CompressionType=self.CompTypeDict[self.CompType], IsMakefile=IsMakefile)
|
||||||
OutputFileList = []
|
OutputFileList = []
|
||||||
OutputFileList.append(OutputFile)
|
OutputFileList.append(OutputFile)
|
||||||
|
Reference in New Issue
Block a user