From nobody Mon Dec 23 09:14:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518163580915622.5211737000114; Fri, 9 Feb 2018 00:06:20 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8FE44222DE157; Fri, 9 Feb 2018 00:00:30 -0800 (PST) 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) 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 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 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; 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 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,482,1511856000"; d="dat'59?scan'59,208,59";a="16831787" From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" 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 Content-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: [edk2] [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: , Cc: "Gao, Liming" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel