From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t4622.austin.hp.com (g2t4622.austin.hp.com [15.73.212.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 335131A1E43 for ; Wed, 26 Oct 2016 20:19:04 -0700 (PDT) Received: from LINDERE4.asiapacific.hpqcorp.net (lindere4.asiapacific.hpqcorp.net [15.117.237.121]) by g2t4622.austin.hp.com (Postfix) with ESMTP id B89A3AA; Thu, 27 Oct 2016 03:19:00 +0000 (UTC) From: Derek Lin To: edk2-devel@lists.01.org Cc: yonghong.zhu@intel.com, liming.gao@intel.com, afish@apple.com, Derek Lin Date: Thu, 27 Oct 2016 11:18:26 +0800 Message-Id: <1477538306-17692-1-git-send-email-derek.lin2@hpe.com> X-Mailer: git-send-email 2.7.4.windows.1 Subject: [PATCH] BaseTools/Genfds: Fix Guid.xref missing GUIDs defined in Library. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 03:19:04 -0000 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 --- 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.
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# # 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