|
From: <gi...@us...> - 2010-08-18 03:22:38
|
Revision: 2016
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2016&view=rev
Author: gikidy
Date: 2010-08-18 03:22:30 +0000 (Wed, 18 Aug 2010)
Log Message:
-----------
Fix below issues:
1. Added support for VPD_FILENAME define in DSC file;
2. Enhanced version and help output;
3. Enhance error handling.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
trunk/BaseTools/Source/Python/BPDG/BPDG.py
trunk/BaseTools/Source/Python/BPDG/GenVpd.py
trunk/BaseTools/Source/Python/BPDG/StringTable.py
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/Common/VpdInfoFile.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -516,7 +516,12 @@
except:
EdkLogger.error("build", FILE_WRITE_FAILURE, "Fail to create FV folder under %s" % self.BuildDir)
- VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid)
+ VpdFileName = self.Platform.VpdFileName
+ if VpdFileName == None :
+ VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid)
+ else :
+ VpdFilePath = os.path.join(FvPath, "%s.txt" % VpdFileName)
+
if not os.path.exists(VpdFilePath) or os.path.getmtime(VpdFilePath) < DscTimeStamp:
VpdFile.Write(VpdFilePath)
@@ -528,16 +533,18 @@
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "PATH attribute was not provided for BPDG guid tool %s in tools_def.txt" % self.Platform.VpdToolGuid)
BPDGToolName = ToolDef["PATH"]
break
-
# Call third party GUID BPDG tool.
if BPDGToolName != None:
- VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)
+ VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath, VpdFileName)
else:
EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")
# Process VPD map file generated by third party BPDG tool
if NeedProcessVpdMapFile:
- VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)
+ if VpdFileName == None :
+ VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)
+ else :
+ VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % VpdFileName)
if os.path.exists(VpdMapFilePath):
VpdFile.Read(VpdMapFilePath)
Modified: trunk/BaseTools/Source/Python/BPDG/BPDG.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/BPDG.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/BPDG/BPDG.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -44,11 +44,12 @@
#
def main():
global Options, Args
+
+ # Initialize log system
+ EdkLogger.Initialize()
Options, Args = myOptionParser()
ReturnCode = 0
- # Initialize log system
- EdkLogger.Initialize()
if Options.opt_slient:
EdkLogger.SetLevel(EdkLogger.ERROR)
@@ -56,24 +57,24 @@
EdkLogger.SetLevel(EdkLogger.VERBOSE)
elif Options.opt_quiet:
EdkLogger.SetLevel(EdkLogger.QUIET)
- elif Options.opt_debug != None:
- EdkLogger.SetLevel(Options.opt_debug + 1)
+ elif Options.debug_level != None:
+ EdkLogger.SetLevel(Options.debug_level + 1)
else:
EdkLogger.SetLevel(EdkLogger.INFO)
- if Options.opt_vpd_filename == None:
- EdkLogger.error("bpdg", ATTRIBUTE_NOT_AVAILABLE, "Please use the -o option to specify the file name for the VPD binary file")
- if Options.opt_map_file == None:
- EdkLogger.error("bpdg", ATTRIBUTE_NOT_AVAILABLE, "Please use the -m option to specify the file name for the mapping file")
+ if Options.vpd_filename == None:
+ EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -o option to specify the file name for the VPD binary file")
+ if Options.filename == None:
+ EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -m option to specify the file name for the mapping file")
Force = False
if Options.opt_force != None:
Force = True
if (Args[0] != None) :
- startBPDG(Args[0], Options.opt_map_file, Options.opt_vpd_filename, Force)
+ startBPDG(Args[0], Options.filename, Options.vpd_filename, Force)
else :
- EdkLogger.error("bpdg", ATTRIBUTE_NOT_AVAILABLE, "Please specify the file which contain the VPD pcd info.",
+ EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please specify the file which contain the VPD pcd info.",
None)
return ReturnCode
@@ -83,11 +84,11 @@
# Process command line firstly.
#
parser = OptionParser(version="%s - Version %s\n" % (PROJECT_NAME, VERSION),
- description=PROJECT_NAME,
- prog='bpdg',
+ description='',
+ prog='BPDG',
usage=st.LBL_BPDG_USAGE
)
- parser.add_option('-d', '--debug', action='store', type="int", dest='opt_debug',
+ parser.add_option('-d', '--debug', action='store', type="int", dest='debug_level',
help=st.MSG_OPTION_DEBUG_LEVEL)
parser.add_option('-v', '--verbose', action='store_true', dest='opt_verbose',
help=st.MSG_OPTION_VERBOSE)
@@ -95,16 +96,17 @@
help=st.MSG_OPTION_SILENT)
parser.add_option('-q', '--quiet', action='store_true', dest='opt_quiet', default=False,
help=st.MSG_OPTION_QUIET)
- parser.add_option('-o', '--vpd-filename', action='store', dest='opt_vpd_filename',
+ parser.add_option('-o', '--vpd-filename', action='store', dest='vpd_filename',
help=st.MSG_OPTION_VPD_FILENAME)
- parser.add_option('-m', '--map-filename', action='store', dest='opt_map_file',
+ parser.add_option('-m', '--map-filename', action='store', dest='filename',
help=st.MSG_OPTION_MAP_FILENAME)
parser.add_option('-f', '--force', action='store_true', dest='opt_force',
help=st.MSG_OPTION_FORCE)
(options, args) = parser.parse_args()
if len(args) == 0:
- print parser.usage
+ EdkLogger.info("Please specify the filename.txt file which contain the VPD pcd info!")
+ EdkLogger.info(parser.usage)
sys.exit(1)
return options, args
@@ -126,7 +128,7 @@
GenVPD.FixVpdOffset()
GenVPD.GenerateVpdFile(MapFileName, VpdFileName)
- EdkLogger.info("- Done! -")
+ EdkLogger.info("- Vpd pcd fixed done! -")
if __name__ == '__main__':
r = main()
Modified: trunk/BaseTools/Source/Python/BPDG/GenVpd.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -1,4 +1,6 @@
## @file
+# This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe
+# and process each entry of vpd type PCD.
#
# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
#
@@ -37,6 +39,15 @@
self.PcdBinOffset = PcdBinOffset
self.PcdBinSize = PcdBinSize
+ if self.PcdValue == '' :
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD format, no Value specified!")
+
+ if self.PcdOffset == '' :
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD format, no Offset specified!")
+
+ if self.PcdSize == '' :
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD format, no PcdSize specified!")
+
self._GenOffsetValue ()
def _IsBoolean(self, ValueString):
@@ -52,7 +63,7 @@
try:
self.PcdBinOffset = int(self.PcdOffset, 16)
except:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"Invalid offset value %s for PCD %s" % (self.PcdOffset, self.PcdCName))
def _PackBooleanValue(self, ValueString):
@@ -63,7 +74,7 @@
def _PackIntValue(self, IntValue, Size):
if Size not in _FORMAT_CHAR.keys():
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"Invalid size %d for PCD in integer datum size." % Size)
self.PcdValue = pack(_FORMAT_CHAR[Size], IntValue)
@@ -75,7 +86,7 @@
elif ValueString.startswith('"') and ValueString.endswith('"'):
self._PackString(ValueString, Size)
else:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"Invalid VOID* type PCD value %s" % ValueString)
def _PackString(self, ValueString, Size):
@@ -85,7 +96,7 @@
ValueString = ValueString[1:-1]
if len(ValueString) + 1 > Size:
- EdkLogger.error("bpdg", BuildToolError.RESOURCE_OVERFLOW,
+ EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
"PCD value string %s is exceed to size %d" % (ValueString, Size))
self.PcdValue= pack('%ds' % Size, ValueString)
@@ -99,7 +110,7 @@
ValueList = [item.strip() for item in ValueList]
if len(ValueList) > Size:
- EdkLogger.error("bpdg", BuildToolError.RESOURCE_OVERFLOW,
+ EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
"The byte array %s is too large for size %d" % (ValueString, Size))
ReturnArray = array.array('B')
@@ -111,7 +122,7 @@
try:
Value = int(ValueList[Index], 16)
except:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"The value item %s in byte array %s is an invalid HEX value." % \
(ValueList[Index], ValueString))
else:
@@ -119,12 +130,12 @@
try:
Value = int(ValueList[Index], 10)
except:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"The value item %s in byte array %s is an invalid DECIMAL value." % \
(ValueList[Index], ValueString))
if Value > 255:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"The value item %s in byte array %s do not in range 0 ~ 0xFF" %\
(ValueList[Index], ValueString))
@@ -146,7 +157,7 @@
UnicodeString = UnicodeString[2:-1]
if (len(UnicodeString) + 1) * 2 > Size:
- EdkLogger.error("bpdg", BuildToolError.RESOURCE_OVERFLOW,
+ EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
"The size of unicode string %s is too larger for size %s" % \
(UnicodeString, Size))
@@ -156,7 +167,7 @@
ReturnArray.append(ord(Value))
ReturnArray.append(0)
except:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID,
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"Invalid unicode character %s in unicode string %s" % \
(Value, UnicodeString))
@@ -184,16 +195,15 @@
self.PcdFixedOffsetSizeList = []
self.PcdUnknownOffsetList = []
try:
- print InputFileName
fInputfile = open(InputFileName, "r", 0)
try:
self.FileLinesList = fInputfile.readlines()
except:
- EdkLogger.error("bpdg", BuildToolError.FILE_READ_FAILURE, "File read failed for %s" %InputFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_READ_FAILURE, "File read failed for %s" %InputFileName,None)
finally:
fInputfile.close()
except:
- EdkLogger.error("bpdg", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %InputFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %InputFileName,None)
##
# Parser the input file which is generated by the build tool. Convert the value of each pcd's
@@ -233,7 +243,7 @@
# Report warning messages to user's.
#
if len(self.FileLinesList) == 0 :
- EdkLogger.warn('bpdg', BuildToolError.RESOURCE_NOT_AVAILABLE,
+ EdkLogger.warn('BPDG', BuildToolError.RESOURCE_NOT_AVAILABLE,
"There are no VPD type pcds defined in DSC file, Please check it.")
# Process the pcds one by one base on the pcd's value and size
@@ -245,8 +255,8 @@
PCD.PcdCName = PCD.PcdCName.strip(' ')
PCD.PcdOffset = PCD.PcdOffset.strip(' ')
PCD.PcdSize = PCD.PcdSize.strip(' ')
- PCD.PcdValue = PCD.PcdValue.strip(' ')
-
+ PCD.PcdValue = PCD.PcdValue.strip(' ')
+
#
# Store the original pcd value.
# This information will be useful while generate the output map file.
@@ -264,7 +274,7 @@
PackSize = int(PCD.PcdSize, 16)
PCD.PcdBinSize = PackSize
except:
- EdkLogger.error("bpdg", BuildToolError.FORMAT_INVALID, "Invalid PCD size value %s" % PCD.PcdSize)
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD size value %s" % PCD.PcdSize)
if PCD._IsBoolean(PCD.PcdValue):
PCD._PackBooleanValue(PCD.PcdValue)
@@ -327,7 +337,7 @@
# Check the offset of VPD type pcd's offset start from 0.
if self.PcdFixedOffsetSizeList[0].PcdBinOffset != 0 :
- EdkLogger.warn("bpdg", "The offset of VPD type pcd should start with 0, please check it.",
+ EdkLogger.warn("BPDG", "The offset of VPD type pcd should start with 0, please check it.",
None)
# Judge whether the offset in fixed pcd offset list is overlapped or not.
@@ -338,19 +348,19 @@
PcdNext = self.PcdFixedOffsetSizeList[count+1]
# Two pcd's offset is same
if PcdNow.PcdBinOffset == PcdNext.PcdBinOffset :
- EdkLogger.error("bpdg", BuildToolError.ATTRIBUTE_GET_FAILURE,
+ EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILURE,
"The offset of %s is same with %s" % (PcdNow.PcdCName, PcdNext.PcdCName),
None)
# Overlapped
if PcdNow.PcdBinOffset + PcdNow.PcdBinSize > PcdNext.PcdBinOffset :
- EdkLogger.error("bpdg", BuildToolError.ATTRIBUTE_GET_FAILURE,
+ EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILURE,
"The offset of %s is overlapped with %s" % (PcdNow.PcdCName, PcdNext.PcdCName),
None)
# Has free space, raise a warning message
if PcdNow.PcdBinOffset + PcdNow.PcdBinSize < PcdNext.PcdBinOffset :
- EdkLogger.warn("bpdg", BuildToolError.ATTRIBUTE_GET_FAILURE,
+ EdkLogger.warn("BPDG", BuildToolError.ATTRIBUTE_GET_FAILURE,
"The offsets have free space of between %s and %s" % (PcdNow.PcdCName, PcdNext.PcdCName),
None)
count += 1
@@ -417,7 +427,7 @@
FixOffsetSizeListCount += 1
# Usually it will not enter into this thunk, if so, means it overlapped.
else :
- EdkLogger.error("bpdg", BuildToolError.ATTRIBUTE_NOT_AVAILABLE,
+ EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_NOT_AVAILABLE,
"The offset value definition has overlapped at pcd: %s, it's offset is: %s" %(eachFixedPcd.PcdCName, eachFixedPcd.PcdOffset),
None)
FixOffsetSizeListCount += 1
@@ -451,13 +461,13 @@
fVpdFile = open (BinFileName, "wb", 0)
except:
# Open failed
- EdkLogger.error("bpdg", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %self.VpdFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %self.VpdFileName,None)
try :
fMapFile = open (MapFileName, "w", 0)
except:
# Open failed
- EdkLogger.error("bpdg", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %self.MapFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %self.MapFileName,None)
# Use a instance of StringIO to cache data
fStringIO = StringIO.StringIO('')
@@ -466,14 +476,14 @@
try :
fMapFile.write (st.MAP_FILE_COMMENT_TEMPLATE + "\n")
except:
- EdkLogger.error("bpdg", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.MapFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.MapFileName,None)
for eachPcd in self.PcdFixedOffsetSizeList :
# write map file
try :
fMapFile.write("%s | %s | %s | %s \n" % (eachPcd.PcdCName, eachPcd.PcdOffset, eachPcd.PcdSize,eachPcd.PcdUnpackValue))
except:
- EdkLogger.error("bpdg", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.MapFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.MapFileName,None)
# Write Vpd binary file
fStringIO.seek (eachPcd.PcdBinOffset)
@@ -486,7 +496,7 @@
try :
fVpdFile.write (fStringIO.getvalue())
except:
- EdkLogger.error("bpdg", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.VpdFileName,None)
+ EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.VpdFileName,None)
fStringIO.close ()
fVpdFile.close ()
Modified: trunk/BaseTools/Source/Python/BPDG/StringTable.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/StringTable.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/BPDG/StringTable.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -45,12 +45,12 @@
-LBL_BPDG_LONG_UNI = (u"Intel Binary Product Data Generation (BPDG) Application")
+LBL_BPDG_LONG_UNI = (u"Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)")
LBL_BPDG_VERSION = (u"0.1")
LBL_BPDG_USAGE = \
(
"""
-Usage: bpdg options -o Filename.bin -m Filename.map Filename.txt
+BPDG options -o Filename.bin -m Filename.map Filename.txt
Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)
Copyright (c) 2010 Intel Corporation All Rights Reserved.
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -354,6 +354,7 @@
TAB_DSC_DEFINES_RT_BASE_ADDRESS = 'RtBaseAddress'
TAB_DSC_DEFINES_DEFINE = 'DEFINE'
TAB_DSC_DEFINES_VPD_TOOL_GUID = 'VPD_TOOL_GUID'
+TAB_DSC_DEFINES_VPD_FILENAME = 'VPD_FILENAME'
TAB_FIX_LOAD_TOP_MEMORY_ADDRESS = 'FIX_LOAD_TOP_MEMORY_ADDRESS'
#
Modified: trunk/BaseTools/Source/Python/Common/VpdInfoFile.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/VpdInfoFile.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/Common/VpdInfoFile.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -210,16 +210,20 @@
# @param ToolPath The string path name for BPDG tool
# @param VpdFileName The string path name for VPD information guid.txt
#
-def CallExtenalBPDGTool(ToolPath, VpdFileName):
+def CallExtenalBPDGTool(ToolPath, VpdFilePath, VpdFileName):
assert ToolPath != None, "Invalid parameter ToolPath"
- assert VpdFileName != None and os.path.exists(VpdFileName), "Invalid parameter VpdFileName"
+ assert VpdFilePath != None and os.path.exists(VpdFilePath), "Invalid parameter VpdFileName"
- OutputDir = os.path.dirname(VpdFileName)
- FileName = os.path.basename(VpdFileName)
- BaseName, ext = os.path.splitext(FileName)
- OutputMapFileName = os.path.join(OutputDir, "%s.map" % BaseName)
- OutputBinFileName = os.path.join(OutputDir, "%s.bin" % BaseName)
-
+ OutputDir = os.path.dirname(VpdFilePath)
+ if (VpdFileName == None) :
+ FileName = os.path.basename(VpdFilePath)
+ BaseName, ext = os.path.splitext(FileName)
+ OutputMapFileName = os.path.join(OutputDir, "%s.map" % BaseName)
+ OutputBinFileName = os.path.join(OutputDir, "%s.bin" % BaseName)
+ else :
+ OutputMapFileName = os.path.join(OutputDir, "%s.map" % VpdFileName)
+ OutputBinFileName = os.path.join(OutputDir, "%s.bin" % VpdFileName)
+
try:
PopenObject = subprocess.Popen([ToolPath,
'-o', OutputBinFileName,
@@ -227,7 +231,7 @@
'-s',
'-f',
'-v',
- VpdFileName],
+ VpdFilePath],
stdout=subprocess.PIPE,
stderr= subprocess.PIPE)
except Exception, X:
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2010-08-16 11:30:42 UTC (rev 2015)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2010-08-18 03:22:30 UTC (rev 2016)
@@ -137,6 +137,7 @@
self._BuildOptions = None
self._LoadFixAddress = None
self._VpdToolGuid = None
+ self._VpdFileName = None
## Get architecture
def _GetArch(self):
@@ -199,8 +200,9 @@
uuid.UUID(Record[1])
except:
EdkLogger.error("build", FORMAT_INVALID, "Invalid GUID format for VPD_TOOL_GUID", File=self.MetaFile)
- self._VpdToolGuid = Record[1]
-
+ self._VpdToolGuid = Record[1]
+ elif Name == TAB_DSC_DEFINES_VPD_FILENAME:
+ self._VpdFileName = Record[1]
# set _Header to non-None in order to avoid database re-querying
self._Header = 'DUMMY'
@@ -344,6 +346,15 @@
if self._VpdToolGuid == None:
self._VpdToolGuid = ''
return self._VpdToolGuid
+
+ ## Retrieve the VPD file Name, this is optional in DSC file
+ def _GetVpdFileName(self):
+ if self._VpdFileName == None:
+ if self._Header == None:
+ self._GetHeaderInfo()
+ if self._VpdFileName == None:
+ self._VpdFileName = ''
+ return self._VpdFileName
## Retrieve [SkuIds] section information
def _GetSkuIds(self):
@@ -782,6 +793,7 @@
RtBaseAddress = property(_GetRtBaseAddress)
LoadFixAddress = property(_GetLoadFixAddress)
VpdToolGuid = property(_GetVpdToolGuid)
+ VpdFileName = property(_GetVpdFileName)
SkuIds = property(_GetSkuIds)
Modules = property(_GetModules)
LibraryInstances = property(_GetLibraryInstances)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|