public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fixed incorrect VPD size.
@ 2018-01-23  8:00 BobCF
  2018-01-25  9:55 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2018-01-23  8:00 UTC (permalink / raw)
  To: edk2-devel

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>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index ce8bc64ca5..848378f3d4 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1744,18 +1744,16 @@ class PlatformAutoGen(AutoGen):
 
                         # Not found, it should be signature
                         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
                                 for eachDec in self.PackageList:
                                     for DecPcd in eachDec.Pcds:
-- 
2.14.3.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-25  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23  8:00 [Patch] BaseTools: Fixed incorrect VPD size BobCF
2018-01-25  9:55 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox