]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools:Make BaseTools support new rules to generate RAW FFS FILE
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FfsInfStatement.py
index 6dcb57deed2e858ec69592a5f0184e3cf800d65b..cd3b0f647793da01772e6fee4a98e3c576a6026d 100644 (file)
@@ -4,13 +4,7 @@
 #  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.<BR>\r
 #\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution.  The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 ##\r
@@ -153,7 +147,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #   @param  self        The object pointer\r
     #   @param  Dict        dictionary contains macro and value pair\r
     #\r
-    def __InfParse__(self, Dict = {}):\r
+    def __InfParse__(self, Dict = None, IsGenFfs=False):\r
 \r
         GenFdsGlobalVariable.VerboseLogger( " Begine parsing INf file : %s" %self.InfFileName)\r
 \r
@@ -190,7 +184,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
 \r
             Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
             #\r
-            # Set Ffs BaseName, MdouleGuid, ModuleType, Version, OutputPath\r
+            # Set Ffs BaseName, ModuleGuid, ModuleType, Version, OutputPath\r
             #\r
             self.BaseName = Inf.BaseName\r
             self.ModuleGuid = Inf.Guid\r
@@ -352,9 +346,12 @@ class FfsInfStatement(FfsInfStatementClassObject):
         GenFdsGlobalVariable.VerboseLogger("InfFileName :%s" % self.InfFileName)\r
 \r
         #\r
-        # Set OutputPath = ${WorkSpace}\Build\Fv\Ffs\${ModuleGuid}+ ${MdouleName}\\r
+        # Set OutputPath = ${WorkSpace}\Build\Fv\Ffs\${ModuleGuid}+ ${ModuleName}\\r
         #\r
-\r
+        if IsGenFfs:\r
+            Rule = self.__GetRule__()\r
+            if GlobalData.gGuidPatternEnd.match(Rule.NameGuid):\r
+                self.ModuleGuid = Rule.NameGuid\r
         self.OutputPath = os.path.join(GenFdsGlobalVariable.FfsDir, \\r
                                        self.ModuleGuid + self.BaseName)\r
         if not os.path.exists(self.OutputPath) :\r
@@ -444,7 +441,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         # Parse Inf file get Module related information\r
         #\r
 \r
-        self.__InfParse__(Dict)\r
+        self.__InfParse__(Dict, IsGenFfs=True)\r
         Arch = self.GetCurrentArch()\r
         SrcFile = mws.join( GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName);\r
         DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')\r