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/AutoGen/WorkspaceAutoGen.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/AutoGen/WorkspaceAutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py index 668126aaac..f86c749c08 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -108,6 +108,10 @@ class WorkspaceAutoGen(AutoGen): #
# Mark now build in AutoGen Phase
#
+ #
+ # Collect Platform Guids to support Guid name in Fdfparser.
+ #
+ self.CollectPlatformGuids()
GlobalData.gAutoGenPhase = True
self.ProcessModuleFromPdf()
self.ProcessPcdType()
@@ -153,6 +157,26 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error("build", PARAMETER_INVALID,
ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]"
% (self.BuildTarget, " ".join(self.Platform.BuildTargets)))
+
+ def CollectPlatformGuids(self):
+ oriInfList = []
+ oriPkgSet = set()
+ PlatformPkg = set()
+ for Arch in self.ArchList:
+ Platform = self.BuildDatabase[self.MetaFile, Arch, self.BuildTarget, self.ToolChain]
+ oriInfList = Platform.Modules
+ for ModuleFile in oriInfList:
+ ModuleData = self.BuildDatabase[ModuleFile, Platform._Arch, Platform._Target, Platform._Toolchain]
+ oriPkgSet.update(ModuleData.Packages)
+ for Pkg in oriPkgSet:
+ Guids = Pkg.Guids
+ GlobalData.gGuidDict.update(Guids)
+ if Platform.Packages:
+ PlatformPkg.update(Platform.Packages)
+ for Pkg in PlatformPkg:
+ Guids = Pkg.Guids
+ GlobalData.gGuidDict.update(Guids)
+
@cached_property
def FdfProfile(self):
if not self.FdfFile:
|