diff options
author | Liming Gao <liming.gao@intel.com> | 2013-11-18 07:41:21 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-11-18 07:41:21 +0000 |
commit | e8a47801a1dfdb148b1bfcd5bdc8ebc3bf51f92d (patch) | |
tree | 04e3ec271347360a5e9da898f1dccbce3d94681f /BaseTools/Source/Python/Common/VpdInfoFile.py | |
parent | fddbbc661eeff8e9f94942fa2d47fb637404a040 (diff) | |
download | edk2-platforms-e8a47801a1dfdb148b1bfcd5bdc8ebc3bf51f92d.tar.xz |
Sync BaseTool trunk (version r2610) into EDKII BaseTools.
Signed-off-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14856 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Common/VpdInfoFile.py')
-rw-r--r-- | BaseTools/Source/Python/Common/VpdInfoFile.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py index 207cc8735b..18f6f5663c 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -138,12 +138,14 @@ class VpdInfoFile: Pcds = self._VpdArray.keys()
Pcds.sort()
for Pcd in Pcds:
+ i = 0
for Offset in self._VpdArray[Pcd]:
- PcdValue = str(Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]].DefaultValue).strip()
+ PcdValue = str(Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[i]].DefaultValue).strip()
if PcdValue == "" :
PcdValue = Pcd.DefaultValue
- fd.write("%s.%s|%s|%s|%s \n" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, str(Offset).strip(), str(Pcd.MaxDatumSize).strip(),PcdValue))
+ fd.write("%s.%s|%s|%s|%s|%s \n" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, str(Pcd.SkuInfoList.keys()[i]),str(Offset).strip(), str(Pcd.MaxDatumSize).strip(),PcdValue))
+ i += 1
except:
EdkLogger.error("VpdInfoFile",
BuildToolError.FILE_WRITE_FAILURE,
@@ -174,21 +176,22 @@ class VpdInfoFile: # the line must follow output format defined in BPDG spec.
#
try:
- PcdName, Offset, Size, Value = Line.split("#")[0].split("|")
+ PcdName, SkuId,Offset, Size, Value = Line.split("#")[0].split("|")
+ PcdName, SkuId,Offset, Size, Value = PcdName.strip(), SkuId.strip(),Offset.strip(), Size.strip(), Value.strip()
TokenSpaceName, PcdTokenName = PcdName.split(".")
except:
EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Fail to parse VPD information file %s" % FilePath)
Found = False
+
for VpdObject in self._VpdArray.keys():
- if VpdObject.TokenSpaceGuidCName == TokenSpaceName and VpdObject.TokenCName == PcdTokenName.strip():
- if self._VpdArray[VpdObject][0] == "*":
- if Offset == "*":
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG tool." % PcdName)
-
- self._VpdArray[VpdObject][0] = Offset
- Found = True
- break
+ for sku in VpdObject.SkuInfoList.keys():
+ if VpdObject.TokenSpaceGuidCName == TokenSpaceName and VpdObject.TokenCName == PcdTokenName.strip() and sku == SkuId:
+ if self._VpdArray[VpdObject][VpdObject.SkuInfoList.keys().index(sku)] == "*":
+ if Offset == "*":
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG tool." % PcdName)
+ self._VpdArray[VpdObject][VpdObject.SkuInfoList.keys().index(sku)] = Offset
+ Found = True
if not Found:
EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Can not find PCD defined in VPD guid file.")
|