From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 E5848223DB796 for ; Thu, 8 Feb 2018 21:06:32 -0800 (PST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2018 21:12:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,482,1511856000"; d="dat'59?scan'59,208,59";a="202779850" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 08 Feb 2018 21:12:16 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Feb 2018 21:12:17 -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 13:12:15 +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: AdOhSAuKVA37nbWPR6yHFAU4m9yZFgAFmQcA Date: Fri, 9 Feb 2018 05:12:15 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC482AB77@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC482AB77@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 05:06:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable First generate a dummy section file with section alignment,=20 then compress the dummy file to generate the compress section Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/CompressSection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/= Source/Python/GenFds/CompressSection.py index 98532ed8e6..af0392c153 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,10 +75,11 @@ clas= s CompressSection (CompressSectionClassObject) : if ReturnSectList !=3D []: if AlignValue =3D=3D None: AlignValue =3D "1" for FileData in ReturnSectList: SectFiles +=3D (FileData,) + SectAlign.append(AlignValue) =20 if MaxAlign !=3D None: if self.Alignment =3D=3D None: self.Alignment =3D MaxAlign else: @@ -89,12 +91,14 @@ class CompressSection (CompressSectionClassObject) : ModuleName + \ 'SEC' + \ SecNum + \ Ffs.SectionSuffix['COMPRESS'] OutputFile =3D os.path.normpath(OutputFile) + DummyFile =3D OutputFile + '.dummy' + GenFdsGlobalVariable.GenerateSection(DummyFile, SectFiles,=20 + InputAlign=3DSectAlign, IsMakefile=3DIsMakefile) =20 - GenFdsGlobalVariable.GenerateSection(OutputFile, SectFiles, Sectio= n.Section.SectionType['COMPRESS'], + GenFdsGlobalVariable.GenerateSection(OutputFile, [DummyFile],=20 + Section.Section.SectionType['COMPRESS'], CompressionType=3Dself.CompTy= peDict[self.CompType], IsMakefile=3DIsMakefile) OutputFileList =3D [] OutputFileList.append(OutputFile) return OutputFileList, self.Alignment =20 -- 2.12.2.windows.2