diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-03-13 15:11:38 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-03-18 16:38:54 +0800 |
commit | 135ae8c873bb18600b8474524453c9ecc6eeed16 (patch) | |
tree | 4c9f84ae3a260dcbcbff167cfda1eab02a5b1f5f /BaseTools | |
parent | 8a0933f436b2014de5402a8c8b4d164a612b9a15 (diff) | |
download | edk2-135ae8c873bb18600b8474524453c9ecc6eeed16.zip edk2-135ae8c873bb18600b8474524453c9ecc6eeed16.tar.gz edk2-135ae8c873bb18600b8474524453c9ecc6eeed16.tar.bz2 |
BaseTools: GenFds get the Size info for FV image in the FD 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=387
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/GenFds/Fv.py | 3 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFds.py | 19 |
2 files changed, 21 insertions, 1 deletions
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,7 +1,7 @@ ## @file
# process FV generation
#
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -50,6 +50,7 @@ class FV (FvClassObject): self.CapsuleName = None
self.FvBaseAddress = None
self.FvForceRebase = None
+ self.FvRegionInFD = None
## AddToBuffer()
#
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 @@ -303,6 +303,25 @@ def main(): """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)
|