diff options
author | Yuwei Chen <yuwei.chen@intel.com> | 2020-07-14 13:30:40 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-07-17 05:25:41 +0000 |
commit | d35773d5c05b078f53d9475bc50ac9dee91b32c5 (patch) | |
tree | a0373caf848384630f869c7743608ef5a46b1594 /BaseTools/Source/Python/GenFds/FdfParser.py | |
parent | 21a23e6966c2eb597a8db98d6837a4c01b3cad4a (diff) | |
download | edk2-d35773d5c05b078f53d9475bc50ac9dee91b32c5.tar.gz edk2-d35773d5c05b078f53d9475bc50ac9dee91b32c5.tar.bz2 edk2-d35773d5c05b078f53d9475bc50ac9dee91b32c5.zip |
BaseTools: Add Guid name support in GenFfs.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2762
The Fv Section in the FDF files use hard coding Guid values
which is inconvenient to manage. This patch adds Guid name
support in GenFfs to solve this problem.
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng<bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 9b04a76af8..ea2401b0e4 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -18,7 +18,7 @@ from uuid import UUID from Common.BuildToolError import *
from Common import EdkLogger
-from Common.Misc import PathClass, tdict, ProcessDuplicatedInf
+from Common.Misc import PathClass, tdict, ProcessDuplicatedInf, GuidStructureStringToGuidString
from Common.StringUtils import NormPath, ReplaceMacro
from Common import GlobalData
from Common.Expression import *
@@ -1087,6 +1087,8 @@ class FdfParser: return False
if GlobalData.gGuidPattern.match(self._Token) is not None:
return True
+ elif self._Token in GlobalData.gGuidDict:
+ return True
else:
self._UndoToken()
return False
@@ -2248,6 +2250,8 @@ class FdfParser: if not self._GetNextGuid():
raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber)
+ if self._Token in GlobalData.gGuidDict:
+ self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper()
FvObj.FvNameGuid = self._Token
@@ -2459,6 +2463,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNumber)
if not self._GetNextGuid():
raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber)
+ if self._Token in GlobalData.gGuidDict:
+ self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper()
FfsInfObj.OverrideGuid = self._Token
if self._IsKeyword("RuleOverride"):
@@ -2550,6 +2556,8 @@ class FdfParser: raise Warning.Expected("')'", self.FileName, self.CurrentLineNumber)
self._Token = 'PCD('+PcdPair[1]+TAB_SPLIT+PcdPair[0]+')'
+ if self._Token in GlobalData.gGuidDict:
+ self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper()
FfsFileObj.NameGuid = self._Token
self._GetFilePart(FfsFileObj)
@@ -2980,6 +2988,8 @@ class FdfParser: elif self._IsKeyword("GUIDED"):
GuidValue = None
if self._GetNextGuid():
+ if self._Token in GlobalData.gGuidDict:
+ self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper()
GuidValue = self._Token
AttribDict = self._GetGuidAttrib()
@@ -4049,6 +4059,8 @@ class FdfParser: elif self._IsKeyword("GUIDED"):
GuidValue = None
if self._GetNextGuid():
+ if self._Token in GlobalData.gGuidDict:
+ self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper()
GuidValue = self._Token
if self._IsKeyword("$(NAMED_GUID)"):
|