Generate GUID cross file in the FV directory after build fds ends successfully.
authorqhuang8 <qhuang8@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 12 Jan 2010 09:20:20 +0000 (09:20 +0000)
committerqhuang8 <qhuang8@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 12 Jan 2010 09:20:20 +0000 (09:20 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1801 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/GenFds/GenFds.py

index 171f7b4..d2c3a35 100644 (file)
@@ -1,7 +1,7 @@
 ## @file
 # generate flash image
 #
-#  Copyright (c) 2007, Intel Corporation
+#  Copyright (c) 2007 - 2010, Intel Corporation
 #
 #  All rights reserved. This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -237,7 +237,10 @@ def main():
             GenFds.PreprocessImage(BuildWorkSpace, GenFdsGlobalVariable.ActivePlatform)
         """Call GenFds"""
         GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
-        
+
+        """Generate GUID cross reference file"""
+        GenFds.GenerateGuidXRefFile(BuildWorkSpace)
+
         """Display FV space info."""
         GenFds.DisplayFvSpaceInfo(FdfParserObj)
         
@@ -476,11 +479,20 @@ class GenFds :
             ModuleObj = BuildDb.BuildObject[Key, 'COMMON']
             print ModuleObj.BaseName + ' ' + ModuleObj.ModuleType
 
+    def GenerateGuidXRefFile(BuildDb):
+        GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, "Guid.xref")
+        GuidXRefFile = open(GuidXRefFileName, "w+")
+        for Module in BuildDb.ModuleList:
+            GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseName))
+        GuidXRefFile.close()
+        GenFdsGlobalVariable.InfLogger("GUID cross reference file saved to %s\n" % GuidXRefFileName)
+        
     ##Define GenFd as static function
     GenFd = staticmethod(GenFd)
     GetFvBlockSize = staticmethod(GetFvBlockSize)
     DisplayFvSpaceInfo = staticmethod(DisplayFvSpaceInfo)
     PreprocessImage = staticmethod(PreprocessImage)
+    GenerateGuidXRefFile = staticmethod(GenerateGuidXRefFile)
 
 if __name__ == '__main__':
     r = main()