summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py25
-rw-r--r--BaseTools/Source/Python/GenFds/Vtf.py8
2 files changed, 33 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index c4358cf479..83b58bcd46 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -3532,6 +3532,11 @@ class FdfParser:
raise Warning("expected Reset file", self.FileName, self.CurrentLineNumber)
VtfObj.ResetBin = self.__Token
+ if VtfObj.ResetBin.replace('$(WORKSPACE)', '').find('$') == -1:
+ #check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(VtfObj.ResetBin), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
while self.__GetComponentStatement(VtfObj):
pass
@@ -3634,6 +3639,11 @@ class FdfParser:
raise Warning("expected Component file", self.FileName, self.CurrentLineNumber)
CompStatementObj.CompBin = self.__Token
+ if CompStatementObj.CompBin != '-' and CompStatementObj.CompBin.replace('$(WORKSPACE)', '').find('$') == -1:
+ #check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(CompStatementObj.CompBin), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not self.__IsKeyword("COMP_SYM"):
raise Warning("expected COMP_SYM", self.FileName, self.CurrentLineNumber)
@@ -3645,6 +3655,11 @@ class FdfParser:
raise Warning("expected Component symbol file", self.FileName, self.CurrentLineNumber)
CompStatementObj.CompSym = self.__Token
+ if CompStatementObj.CompSym != '-' and CompStatementObj.CompSym.replace('$(WORKSPACE)', '').find('$') == -1:
+ #check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(CompStatementObj.CompSym), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not self.__IsKeyword("COMP_SIZE"):
raise Warning("expected COMP_SIZE", self.FileName, self.CurrentLineNumber)
@@ -3722,6 +3737,11 @@ class FdfParser:
if not self.__GetNextToken():
raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)
ffsInf.InfFileName = self.__Token
+ if ffsInf.InfFileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not ffsInf.InfFileName in self.Profile.InfList:
self.Profile.InfList.append(ffsInf.InfFileName)
@@ -3814,6 +3834,11 @@ class FdfParser:
if not self.__GetNextToken():
raise Warning("expected File path", self.FileName, self.CurrentLineNumber)
FfsFileObj.FileName = self.__Token
+ if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if FfsFileObj.FileType == 'EFI':
self.__GetOptRomOverrides(FfsFileObj)
diff --git a/BaseTools/Source/Python/GenFds/Vtf.py b/BaseTools/Source/Python/GenFds/Vtf.py
index 2bea9346cf..e7e36491db 100644
--- a/BaseTools/Source/Python/GenFds/Vtf.py
+++ b/BaseTools/Source/Python/GenFds/Vtf.py
@@ -67,6 +67,14 @@ class Vtf (VtfClassObject):
FvList = self.GetFvList()
self.BsfInfName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.inf')
BsfInf = open (self.BsfInfName, 'w+')
+ if self.ResetBin != None:
+ BsfInf.writelines ("[OPTIONS]" + T_CHAR_LF)
+ BsfInf.writelines ("IA32_RST_BIN" + \
+ " = " + \
+ GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.ResetBin)) + \
+ T_CHAR_LF )
+ BsfInf.writelines (T_CHAR_LF )
+
BsfInf.writelines ("[COMPONENTS]" + T_CHAR_LF)
for ComponentObj in self.ComponentStatementList :