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
This commit is contained in:
Liming Gao
2013-11-18 07:41:21 +00:00
committed by lgao4
parent fddbbc661e
commit e8a47801a1
65 changed files with 3487 additions and 1302 deletions

View File

@ -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.")