public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Derek Lin <derek.lin2@hpe.com>
To: edk2-devel@lists.01.org
Cc: yonghong.zhu@intel.com, liming.gao@intel.com, afish@apple.com,
	Derek Lin <derek.lin2@hpe.com>
Subject: [PATCH] BaseTools/Genfds: Fix Guid.xref missing GUIDs defined in Library.
Date: Thu, 27 Oct 2016 11:18:26 +0800	[thread overview]
Message-ID: <1477538306-17692-1-git-send-email-derek.lin2@hpe.com> (raw)

The original Guid.xref lost some Guid which only defined in Library. When the library is used by a driver, its Guids were not listed in Guid.xref. Now they will.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
---
 BaseTools/Source/Python/GenFds/GenFds.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index c2e9418..9c2f0ad 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -2,6 +2,7 @@
 # generate flash image
 #
 #  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -698,18 +699,22 @@ class GenFds :
     def GenerateGuidXRefFile(BuildDb, ArchList):
         GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, "Guid.xref")
         GuidXRefFile = StringIO.StringIO('')
+        ModuleGuidDict = {}
         GuidDict = {}
         for Arch in ArchList:
             PlatformDataBase = BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
-            for ModuleFile in PlatformDataBase.Modules:
+            for ModuleFile in [x for x in PlatformDataBase.Modules] + [x for x in PlatformDataBase.LibraryInstances]:
                 Module = BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
-                GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseName))
+                ModuleGuidDict[Module.BaseName] = Module.Guid
                 for key, item in Module.Protocols.items():
                     GuidDict[key] = item
                 for key, item in Module.Guids.items():
                     GuidDict[key] = item
                 for key, item in Module.Ppis.items():
                     GuidDict[key] = item
+        # Append Module/Lib Guid to the Xref file
+        for key, item in ModuleGuidDict.items():
+            GuidXRefFile.write("%s %s\n" % (item.upper(), key))
        # Append GUIDs, Protocols, and PPIs to the Xref file
         GuidXRefFile.write("\n")
         for key, item in GuidDict.items():
-- 
2.7.4.windows.1



                 reply	other threads:[~2016-10-27  3:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477538306-17692-1-git-send-email-derek.lin2@hpe.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox