]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/AprioriSection.py
BaseTools: Update Makefile to support FFS file generation
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / AprioriSection.py
index a2306d062d2dea61eb1564baa3b972e81ced42cc..70e2e5a3baf23e86b8b9e11af8f3913744df450a 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process APRIORI file data and generate PEI/DXE APRIORI file\r
 #\r
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<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
@@ -47,7 +47,7 @@ class AprioriSection (AprioriSectionClassObject):
     #   @param  Dict        dictionary contains macro and its value\r
     #   @retval string      Generated file name\r
     #\r
-    def GenFfs (self, FvName, Dict = {}):\r
+    def GenFfs (self, FvName, Dict = {}, IsMakefile = False):\r
         DXE_GUID = "FC510EE7-FFDC-11D4-BD41-0080C73C8881"\r
         PEI_GUID = "1B45CC0A-156A-428A-AF62-49864DA0E6E6"\r
         Buffer = StringIO.StringIO('')\r
@@ -66,6 +66,7 @@ class AprioriSection (AprioriSectionClassObject):
                                     AprioriFileGuid + FvName + '.Ffs')\r
 \r
         Dict.update(self.DefineVarDict)\r
+        InfFileName = None\r
         for FfsObj in self.FfsList :\r
             Guid = ""\r
             if isinstance(FfsObj, FfsFileStatement.FileStatement):\r
@@ -110,9 +111,14 @@ class AprioriSection (AprioriSectionClassObject):
 \r
         RawSectionFileName = os.path.join( OutputAprFilePath, \\r
                                        AprioriFileGuid + FvName + '.raw' )\r
-        GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [OutputAprFileName], 'EFI_SECTION_RAW')\r
+        MakefilePath = None\r
+        if IsMakefile:\r
+            if not InfFileName:\r
+                return None\r
+            MakefilePath = InfFileName, Arch\r
+        GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [OutputAprFileName], 'EFI_SECTION_RAW', IsMakefile=IsMakefile)\r
         GenFdsGlobalVariable.GenerateFfs(AprFfsFileName, [RawSectionFileName],\r
-                                         'EFI_FV_FILETYPE_FREEFORM', AprioriFileGuid)\r
+                                        'EFI_FV_FILETYPE_FREEFORM', AprioriFileGuid, MakefilePath=MakefilePath)\r
 \r
         return AprFfsFileName\r
 \r