From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8EBA223DB780 for ; Fri, 9 Feb 2018 00:00:28 -0800 (PST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 00:06:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,482,1511856000"; d="dat'59?scan'59,208,59";a="16831787" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 09 Feb 2018 00:06:11 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 9 Feb 2018 00:06:10 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 9 Feb 2018 00:06:10 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0319.002; Fri, 9 Feb 2018 16:06:08 +0800 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Zhu, Yonghong" , "Gao, Liming" Thread-Topic: [PATCH] BaseTool: correct the generate compress section process Thread-Index: AdOhfNbmA1CdP1tiSdmWctofvOLvHA== Date: Fri, 9 Feb 2018 08:06:07 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC482AC28@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC482AC28@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: [PATCH] BaseTool: correct the generate compress section process X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2018 08:00:29 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable First generate a dummy file with section alignment, then compress the dummy file to generate the compress file Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/CompressSection.py | 13 +++++-------- 1 file 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 @@ -58,10 +58,11 @@ class CompressSection (CompressSectionClassObject) : if FfsInf !=3D None: self.CompType =3D FfsInf.__ExtendMacro__(self.CompType) self.Alignment =3D FfsInf.__ExtendMacro__(self.Alignment) =20 SectFiles =3D tuple() + SectAlign =3D [] Index =3D 0 MaxAlign =3D None for Sect in self.SectionList: Index =3D Index + 1 SecIndex =3D '%s.%d' %(SecNum, Index) @@ -74,27 +75,23 @@ class CompressSection (CompressSectionClassObject) : if ReturnSectList !=3D []: if AlignValue =3D=3D None: AlignValue =3D "1" for FileData in ReturnSectList: SectFiles +=3D (FileData,) - - if MaxAlign !=3D None: - if self.Alignment =3D=3D None: - self.Alignment =3D MaxAlign - else: - if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGl= obalVariable.GetAlignment (self.Alignment): - self.Alignment =3D MaxAlign + SectAlign.append(AlignValue) =20 OutputFile =3D OutputPath + \ os.sep + \ ModuleName + \ 'SEC' + \ SecNum + \ Ffs.SectionSuffix['COMPRESS'] OutputFile =3D os.path.normpath(OutputFile) + DummyFile =3D OutputFile + '.dummy' + GenFdsGlobalVariable.GenerateSection(DummyFile, SectFiles, InputAl= ign=3DSectAlign, IsMakefile=3DIsMakefile) =20 - GenFdsGlobalVariable.GenerateSection(OutputFile, SectFiles, Sectio= n.Section.SectionType['COMPRESS'], + GenFdsGlobalVariable.GenerateSection(OutputFile, [DummyFile], Sect= ion.Section.SectionType['COMPRESS'], CompressionType=3Dself.CompTy= peDict[self.CompType], IsMakefile=3DIsMakefile) OutputFileList =3D [] OutputFileList.append(OutputFile) return OutputFileList, self.Alignment =20 --=20 2.12.2.windows.2