]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Guid.xref doesn't specify the correct GUID value for Driver
authorYunhua Feng <yunhuax.feng@intel.com>
Tue, 31 Jul 2018 01:44:41 +0000 (09:44 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 3 Aug 2018 02:28:18 +0000 (10:28 +0800)
In DSC, we can define the driver with the different FILE GUID. So this
driver name and its FILE GUID should also be listed in Build output
Guid.xref. But now, Guid.xref still lists the driver MODULE_GUID.

The case in Platform.dsc:
  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {
    <Defines>
      FILE_GUID = 3A4A354F-6935-40fa-B19C-500EEEBF0BC2
    <LibraryClasses>
      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
  }

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/GenFds/GenFds.py

index a7c1e6c853342ff1b2aedc82098d262603800e06..156aae1d0e3756b58e108386c00da3052b9e42a7 100644 (file)
@@ -605,6 +605,11 @@ class GenFds :
         GuidDict = {}\r
         ModuleList = []\r
         FileGuidList = []\r
+        GuidPattern = re.compile("\s*([0-9a-fA-F]){8}-"\r
+                                       "([0-9a-fA-F]){4}-"\r
+                                       "([0-9a-fA-F]){4}-"\r
+                                       "([0-9a-fA-F]){4}-"\r
+                                       "([0-9a-fA-F]){12}\s*")\r
         for Arch in ArchList:\r
             PlatformDataBase = BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
             for ModuleFile in PlatformDataBase.Modules:\r
@@ -613,7 +618,11 @@ class GenFds :
                     continue\r
                 else:\r
                     ModuleList.append(Module)\r
-                GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseName))\r
+                GuidMatch = GuidPattern.match(ModuleFile.BaseName)\r
+                if GuidMatch is not None:\r
+                    GuidXRefFile.write("%s %s\n" % (ModuleFile.BaseName, Module.BaseName))\r
+                else:\r
+                    GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseName))\r
                 for key, item in Module.Protocols.items():\r
                     GuidDict[key] = item\r
                 for key, item in Module.Guids.items():\r