summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/CompressSection.py
diff options
context:
space:
mode:
authorFeng, YunhuaX <yunhuax.feng@intel.com>2018-02-09 16:06:07 +0800
committerLiming Gao <liming.gao@intel.com>2018-02-09 17:07:55 +0800
commitce2818e418020a9cf84f6712cbda4075b0652809 (patch)
tree04454353fa48424675e70a559d443fdebffd7c0f /BaseTools/Source/Python/GenFds/CompressSection.py
parent582e4e449d5ebcc2fa66faf252751b8a2b22b002 (diff)
downloadedk2-ce2818e418020a9cf84f6712cbda4075b0652809.tar.gz
edk2-ce2818e418020a9cf84f6712cbda4075b0652809.tar.bz2
edk2-ce2818e418020a9cf84f6712cbda4075b0652809.zip
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>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/CompressSection.py')
-rw-r--r--BaseTools/Source/Python/GenFds/CompressSection.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/Source/Python/GenFds/CompressSection.py
index 98532ed8e6..56e71a3545 100644
--- a/BaseTools/Source/Python/GenFds/CompressSection.py
+++ b/BaseTools/Source/Python/GenFds/CompressSection.py
@@ -60,6 +60,7 @@ class CompressSection (CompressSectionClassObject) :
self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
SectFiles = tuple()
+ SectAlign = []
Index = 0
MaxAlign = None
for Sect in self.SectionList:
@@ -76,13 +77,7 @@ class CompressSection (CompressSectionClassObject) :
AlignValue = "1"
for FileData in ReturnSectList:
SectFiles += (FileData,)
-
- if MaxAlign != None:
- if self.Alignment == None:
- self.Alignment = MaxAlign
- else:
- if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGlobalVariable.GetAlignment (self.Alignment):
- self.Alignment = MaxAlign
+ SectAlign.append(AlignValue)
OutputFile = OutputPath + \
os.sep + \
@@ -91,8 +86,10 @@ class CompressSection (CompressSectionClassObject) :
SecNum + \
Ffs.SectionSuffix['COMPRESS']
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)
OutputFileList = []
OutputFileList.append(OutputFile)