From: BobCF Date: Tue, 23 Jan 2018 08:00:59 +0000 (+0800) Subject: BaseTools: Fixed incorrect VPD size. X-Git-Tag: edk2-stable201903~2533 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e827d21da1c21aea0e1cdc9b896aacf988a5bacd 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 Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 2800820b72..ab178c9a4a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1746,14 +1746,12 @@ class PlatformAutoGen(AutoGen): if not FoundFlag : # just pick the a value to determine whether is unicode string type SkuValueMap = {} + SkuObjList = DscPcdEntry.SkuInfoList.items() DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT') if DefaultSku: - PcdValue = DefaultSku.DefaultValue - if PcdValue not in SkuValueMap: - SkuValueMap[PcdValue] = [] - VpdFile.Add(DscPcdEntry, 'DEFAULT',DefaultSku.VpdOffset) - SkuValueMap[PcdValue].append(DefaultSku) - for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items(): + defaultindex = SkuObjList.index(('DEFAULT',DefaultSku)) + SkuObjList[0],SkuObjList[defaultindex] = SkuObjList[defaultindex],SkuObjList[0] + for (SkuName,Sku) in SkuObjList: Sku.VpdOffset = Sku.VpdOffset.strip() # Need to iterate DEC pcd information to get the value & datumtype