From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 AFA63802B1 for ; Tue, 14 Mar 2017 22:46:10 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 14 Mar 2017 22:46:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,167,1486454400"; d="scan'208";a="236280511" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 14 Mar 2017 22:46:10 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Mar 2017 22:46:09 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Wed, 15 Mar 2017 13:46:06 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: GenFds get the Size info for FV image in the FD region Thread-Index: AQHSnSq22J8wIr/7LUukUct8nnOGRKGVZH7Q Date: Wed, 15 Mar 2017 05:46:05 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6F0166@shsmsx102.ccr.corp.intel.com> References: <1489540978-18452-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1489540978-18452-1-git-send-email-yonghong.zhu@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] BaseTools: GenFds get the Size info for FV image in the FD region X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2017 05:46:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Wednesday, March 15, 2017 9:23 AM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch] BaseTools: GenFds get the Size info for FV image in the F= D >region > >When the FV size is specify in the FD region, Tool generate the FV file >may not use the correct size. > >Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D387 >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/GenFds/Fv.py | 3 ++- > BaseTools/Source/Python/GenFds/GenFds.py | 19 +++++++++++++++++++ > 2 files changed, 21 insertions(+), 1 deletion(-) > >diff --git a/BaseTools/Source/Python/GenFds/Fv.py >b/BaseTools/Source/Python/GenFds/Fv.py >index ab3f8b2..f6ccb59 100644 >--- a/BaseTools/Source/Python/GenFds/Fv.py >+++ b/BaseTools/Source/Python/GenFds/Fv.py >@@ -1,9 +1,9 @@ > ## @file > # process FV generation > # >-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
>+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the = BSD >License > # which accompanies this distribution. The full text of the license may= be >found at > # http://opensource.org/licenses/bsd-license.php >@@ -48,10 +48,11 @@ class FV (FvClassObject): > self.InfFileName =3D None > self.FvAddressFileName =3D None > self.CapsuleName =3D None > self.FvBaseAddress =3D None > self.FvForceRebase =3D None >+ self.FvRegionInFD =3D None > > ## AddToBuffer() > # > # Generate Fv and add it to the Buffer > # >diff --git a/BaseTools/Source/Python/GenFds/GenFds.py >b/BaseTools/Source/Python/GenFds/GenFds.py >index a8a68da..aa8c041 100644 >--- a/BaseTools/Source/Python/GenFds/GenFds.py >+++ b/BaseTools/Source/Python/GenFds/GenFds.py >@@ -301,10 +301,29 @@ def main(): > CheckBuildOptionPcd() > > """Modify images from build output if the feature of loading driv= er at >fixed address is on.""" > if GenFdsGlobalVariable.FixedLoadAddress: > GenFds.PreprocessImage(BuildWorkSpace, >GenFdsGlobalVariable.ActivePlatform) >+ >+ # Record the FV Region info that may specific in the FD >+ if FdfParserObj.Profile.FvDict and FdfParserObj.Profile.FdDict: >+ for Fv in FdfParserObj.Profile.FvDict: >+ FvObj =3D FdfParserObj.Profile.FvDict[Fv] >+ for Fd in FdfParserObj.Profile.FdDict: >+ FdObj =3D FdfParserObj.Profile.FdDict[Fd] >+ for RegionObj in FdObj.RegionList: >+ if RegionObj.RegionType !=3D 'FV': >+ continue >+ for RegionData in RegionObj.RegionDataList: >+ if FvObj.UiFvName.upper() =3D=3D RegionData.u= pper(): >+ if FvObj.FvRegionInFD: >+ if FvObj.FvRegionInFD !=3D RegionObj.= Size: >+ EdkLogger.error("GenFds", FORMAT_= INVALID, "The >FV %s's region is specified in multiple FD with different >value." %FvObj.UiFvName) >+ else: >+ FvObj.FvRegionInFD =3D RegionObj.Size >+ RegionObj.BlockInfoOfRegion(FdObj.Blo= ckSizeList, FvObj) >+ > """Call GenFds""" > GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList) > > """Generate GUID cross reference file""" > GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList) >-- >2.6.1.windows.1