BaseTools: Fixed incorrect VPD size.

The VPD size is incorrect if that VPD is not used in Module.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
BobCF 2018-01-23 16:00:59 +08:00 committed by Liming Gao
parent 9904222db0
commit e827d21da1
1 changed files with 4 additions and 6 deletions

View File

@ -1746,14 +1746,12 @@ class PlatformAutoGen(AutoGen):
if not FoundFlag : if not FoundFlag :
# just pick the a value to determine whether is unicode string type # just pick the a value to determine whether is unicode string type
SkuValueMap = {} SkuValueMap = {}
SkuObjList = DscPcdEntry.SkuInfoList.items()
DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT') DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT')
if DefaultSku: if DefaultSku:
PcdValue = DefaultSku.DefaultValue defaultindex = SkuObjList.index(('DEFAULT',DefaultSku))
if PcdValue not in SkuValueMap: SkuObjList[0],SkuObjList[defaultindex] = SkuObjList[defaultindex],SkuObjList[0]
SkuValueMap[PcdValue] = [] for (SkuName,Sku) in SkuObjList:
VpdFile.Add(DscPcdEntry, 'DEFAULT',DefaultSku.VpdOffset)
SkuValueMap[PcdValue].append(DefaultSku)
for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items():
Sku.VpdOffset = Sku.VpdOffset.strip() Sku.VpdOffset = Sku.VpdOffset.strip()
# Need to iterate DEC pcd information to get the value & datumtype # Need to iterate DEC pcd information to get the value & datumtype