]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/Section.py
BaseTools:Make BaseTools support new rules to generate RAW FFS FILE
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / Section.py
index 19a70009dccea4cd157017137aea3a1a9dcc75a5..b2389566349855b8bedb9f22d5dbfa99c9ba968d 100644 (file)
@@ -3,13 +3,7 @@
 #\r
 #  Copyright (c) 2007-2018, 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
-#  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
@@ -112,7 +106,7 @@ class Section (SectionClassObject):
     #   @param  Dict        dictionary contains macro and its value\r
     #   @retval tuple       (File list, boolean)\r
     #\r
-    def GetFileList(FfsInf, FileType, FileExtension, Dict = {}, IsMakefile=False):\r
+    def GetFileList(FfsInf, FileType, FileExtension, Dict = None, IsMakefile=False, SectionType=None):\r
         IsSect = FileType in Section.SectFileType\r
 \r
         if FileExtension is not None:\r
@@ -131,7 +125,7 @@ class Section (SectionClassObject):
                     if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \\r
                                                  and FileType == 'DXE_DPEX' and File.Type == BINARY_FILE_TYPE_SMM_DEPEX) \\r
                                                  or (FileType == BINARY_FILE_TYPE_TE and File.Type == BINARY_FILE_TYPE_PE32):\r
-                        if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:\r
+                        if TAB_STAR in FfsInf.TargetOverrideList or File.Target == TAB_STAR or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:\r
                             FileList.append(FfsInf.PatchEfiFile(File.Path, File.Type))\r
                         else:\r
                             GenFdsGlobalVariable.InfLogger ("\nBuild Target \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(File.Target, File.File, FfsInf.TargetOverrideList, FfsInf.InfFileName))\r
@@ -140,6 +134,11 @@ class Section (SectionClassObject):
                 else:\r
                     GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))\r
 \r
+        elif FileType is None and SectionType == BINARY_FILE_TYPE_RAW:\r
+            for File in FfsInf.BinFileList:\r
+                if File.Ext == Suffix:\r
+                    FileList.append(File.Path)\r
+\r
         if (not IsMakefile and Suffix is not None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not None):\r
             #\r
             # Get Makefile path and time stamp\r