summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorYingke Liu <yingke.d.liu@intel.com>2015-08-28 02:04:37 +0000
committeryingke <yingke@Edk2>2015-08-28 02:04:37 +0000
commit29d960f90134b84d59b0b8e8574e02358ce13cce (patch)
treeefecb5e915ae144934d3635f9354654761cc790b /BaseTools/Source/Python
parentb390d5a8cff3d0fbcea4c2b3e632da6bb447ffe8 (diff)
downloadedk2-platforms-29d960f90134b84d59b0b8e8574e02358ce13cce.tar.xz
BaseTools: Fixed bug for single FV generating.
If -i is specified and this FV has no BlockSize defined, tool did not inherit FD's BlockSize. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18339 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/GenFds/Fv.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py
index d770582326..163ccd37f1 100644
--- a/BaseTools/Source/Python/GenFds/Fv.py
+++ b/BaseTools/Source/Python/GenFds/Fv.py
@@ -207,6 +207,30 @@ class FV (FvClassObject):
GenFdsGlobalVariable.LargeFileInFvFlags.pop()
return FvOutputFile
+ ## _GetBlockSize()
+ #
+ # Calculate FV's block size
+ # Inherit block size from FD if no block size specified in FV
+ #
+ def _GetBlockSize(self):
+ if self.BlockSizeList:
+ return True
+
+ for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
+ FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]
+ for RegionObj in FdObj.RegionList:
+ if RegionObj.RegionType != 'FV':
+ continue
+ for RegionData in RegionObj.RegionDataList:
+ #
+ # Found the FD and region that contain this FV
+ #
+ if self.UiFvName.upper() == RegionData.upper():
+ RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, self)
+ if self.BlockSizeList:
+ return True
+ return False
+
## __InitializeInf__()
#
# Initilize the inf file to create FV
@@ -245,8 +269,9 @@ class FV (FvClassObject):
T_CHAR_LF)
else:
if self.BlockSizeList == []:
- #set default block size is 1
- self.FvInfFile.writelines("EFI_BLOCK_SIZE = 0x1" + T_CHAR_LF)
+ if not self._GetBlockSize():
+ #set default block size is 1
+ self.FvInfFile.writelines("EFI_BLOCK_SIZE = 0x1" + T_CHAR_LF)
for BlockSize in self.BlockSizeList :
if BlockSize[0] != None: