From nobody Sat Nov 2 12:18:14 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zoho.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 1489540985782444.01910126190046; Tue, 14 Mar 2017 18:23:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4DBBE803D3; Tue, 14 Mar 2017 18:23:04 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 D1F948039D for ; Tue, 14 Mar 2017 18:23:02 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2017 18:23:02 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga003.jf.intel.com with ESMTP; 14 Mar 2017 18:23:01 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489540982; x=1521076982; h=from:to:cc:subject:date:message-id; bh=jzv6KvV2soByIDB1ctb+baYpDVY4tL2ZssBNbvW3C6M=; b=Vj28zcha6gUq6G90xtPkKKeqP1tbBXHDq6h8Dea5YLJbOqzE+zXvQAqD pF4Al10csI3FlgHnY6vFex22yDm9+g==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,166,1486454400"; d="scan'208";a="944371305" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Wed, 15 Mar 2017 09:22:58 +0800 Message-Id: <1489540978-18452-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [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: , Cc: Liming Gao MIME-Version: 1.0 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" 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 Reviewed-by: Liming Gao --- 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 B= SD 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 =20 ## AddToBuffer() # # Generate Fv and add it to the Buffer # diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/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() =20 """Modify images from build output if the feature of loading drive= r at fixed address is on.""" if GenFdsGlobalVariable.FixedLoadAddress: GenFds.PreprocessImage(BuildWorkSpace, GenFdsGlobalVariable.Ac= tivePlatform) + + # 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.up= per(): + if FvObj.FvRegionInFD: + if FvObj.FvRegionInFD !=3D RegionObj.S= ize: + EdkLogger.error("GenFds", FORMAT_I= NVALID, "The FV %s's region is specified in multiple FD with different valu= e." %FvObj.UiFvName) + else: + FvObj.FvRegionInFD =3D RegionObj.Size + RegionObj.BlockInfoOfRegion(FdObj.Bloc= kSizeList, FvObj) + """Call GenFds""" GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList) =20 """Generate GUID cross reference file""" GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList) --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel