summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds/FdfParser.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 69a4898499..c4358cf479 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -43,6 +43,8 @@ import OptRomFileStatement
from GenFdsGlobalVariable import GenFdsGlobalVariable
from Common.BuildToolError import *
from Common import EdkLogger
+from Common.Misc import PathClass
+from Common.String import NormPath
import re
import os
@@ -205,6 +207,8 @@ class FdfParser:
self.__SkippedChars = ""
self.__WipeOffArea = []
+ if GenFdsGlobalVariable.WorkSpaceDir == '':
+ GenFdsGlobalVariable.WorkSpaceDir = os.getenv("WORKSPACE")
## __IsWhiteSpace() method
#
@@ -2145,6 +2149,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:
+ #do case sensitive 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)
@@ -2352,6 +2361,11 @@ class FdfParser:
self.__GetSectionData( FfsFileObj, MacroDict)
else:
FfsFileObj.FileName = self.__Token
+ if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not self.__IsToken( "}"):
raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
@@ -2597,6 +2611,11 @@ class FdfParser:
if not self.__GetNextToken():
raise Warning("expected section file path", self.FileName, self.CurrentLineNumber)
DataSectionObj.SectFileName = self.__Token
+ if DataSectionObj.SectFileName.replace('$(WORKSPACE)', '').find('$') == -1:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(DataSectionObj.SectFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
else:
if not self.__GetCglSection(DataSectionObj):
return False
@@ -2684,8 +2703,8 @@ class FdfParser:
def __GetGuidAttrib(self):
AttribDict = {}
- AttribDict["PROCESSING_REQUIRED"] = False
- AttribDict["AUTH_STATUS_VALID"] = False
+ AttribDict["PROCESSING_REQUIRED"] = "NONE"
+ AttribDict["AUTH_STATUS_VALID"] = "NONE"
if self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID"):
AttribKey = self.__Token