From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) 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==; 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,166,1486454400"; d="scan'208";a="944371305" 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 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao 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: [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 01:23:03 -0000 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=387 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 = None self.FvAddressFileName = None self.CapsuleName = None self.FvBaseAddress = None self.FvForceRebase = None + self.FvRegionInFD = 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 driver 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 = FdfParserObj.Profile.FvDict[Fv] + for Fd in FdfParserObj.Profile.FdDict: + FdObj = FdfParserObj.Profile.FdDict[Fd] + for RegionObj in FdObj.RegionList: + if RegionObj.RegionType != 'FV': + continue + for RegionData in RegionObj.RegionDataList: + if FvObj.UiFvName.upper() == RegionData.upper(): + if FvObj.FvRegionInFD: + if FvObj.FvRegionInFD != 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 = RegionObj.Size + RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj) + """Call GenFds""" GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList) """Generate GUID cross reference file""" GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList) -- 2.6.1.windows.1