X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FEfiSection.py;h=74f176cfef2f9833169f1c2b7994ee1c2385ff71;hp=dfb2470874e66fe1838ef31d416066fd07c16692;hb=04797875d1d53e53e31eca4fa01bc3cf6929f39c;hpb=b3e94a06172113991f28a1eff096255c65702a0c diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py index dfb2470874..74f176cfef 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -3,13 +3,7 @@ # # Copyright (c) 2007 - 2018, 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 -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -99,7 +93,7 @@ class EfiSection (EfiSectionClassObject): if '.depex' in SuffixMap: FileList.append(Filename) else: - FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile) + FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile, SectionType=SectionType) if IsSect : return FileList, self.Alignment @@ -223,6 +217,26 @@ class EfiSection (EfiSectionClassObject): Ui=StringData, IsMakefile=IsMakefile) OutputFileList.append(OutputFile) + # + # If Section Type is BINARY_FILE_TYPE_RAW + # + elif SectionType == BINARY_FILE_TYPE_RAW: + """If File List is empty""" + if FileList == []: + if self.Optional == True: + GenFdsGlobalVariable.VerboseLogger("Optional Section don't exist!") + return [], None + else: + EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for %s section could not be found for %s" % (SectionType, InfFileName)) + + elif len(FileList) > 1: + EdkLogger.error("GenFds", GENFDS_ERROR, + "Files suffixed with %s are not allowed to have more than one file in %s[Binaries] section" % ( + self.FileExtension, InfFileName)) + else: + for File in FileList: + File = GenFdsGlobalVariable.MacroExtend(File, Dict) + OutputFileList.append(File) else: """If File List is empty"""