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.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 E2324223DB798 for ; Fri, 9 Feb 2018 00:55:12 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 01:00:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,482,1511856000"; d="scan'208";a="16841506" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 09 Feb 2018 01:00:55 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 9 Feb 2018 01:00:55 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 9 Feb 2018 01:00:54 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Fri, 9 Feb 2018 17:00:53 +0800 From: "Gao, Liming" To: "Feng, YunhuaX" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTool: correct the generate compress section process Thread-Index: AdOhfNbmA1CdP1tiSdmWctofvOLvHAAB6GrQ Date: Fri, 9 Feb 2018 09:00:52 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1CAE36@SHSMSX104.ccr.corp.intel.com> References: <47C64442C08CCD4089DC43B6B5E46BC482AC28@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC482AC28@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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:55:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, YunhuaX >Sent: Friday, February 09, 2018 4:06 PM >To: edk2-devel@lists.01.org >Cc: Zhu, Yonghong ; Gao, Liming > >Subject: [PATCH] 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 >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) > > 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) > >GenFdsGlobalVariable.GetAlignment (self.Alignment): >- self.Alignment =3D MaxAlign >+ SectAlign.append(AlignValue) > > 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, >InputAlign=3DSectAlign, IsMakefile=3DIsMakefile) > >- GenFdsGlobalVariable.GenerateSection(OutputFile, SectFiles, >Section.Section.SectionType['COMPRESS'], >+ GenFdsGlobalVariable.GenerateSection(OutputFile, [DummyFile], >Section.Section.SectionType['COMPRESS'], > CompressionType=3Dself.CompT= ypeDict[self.CompType], >IsMakefile=3DIsMakefile) > OutputFileList =3D [] > OutputFileList.append(OutputFile) > return OutputFileList, self.Alignment > >-- >2.12.2.windows.2