X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FAprioriSection.py;h=70e2e5a3baf23e86b8b9e11af8f3913744df450a;hb=cf245466a56a7be7405142753c6c6a6689b7461b;hp=92a9794f51f58e91c4f54ce67e428cdb8b5cd302;hpb=30fdf1140b8d1ce93f3821d986fa165552023440;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/GenFds/AprioriSection.py b/BaseTools/Source/Python/GenFds/AprioriSection.py index 92a9794f51..70e2e5a3ba 100644 --- a/BaseTools/Source/Python/GenFds/AprioriSection.py +++ b/BaseTools/Source/Python/GenFds/AprioriSection.py @@ -1,9 +1,9 @@ ## @file # process APRIORI file data and generate PEI/DXE APRIORI file # -# Copyright (c) 2007, Intel Corporation +# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
# -# All rights reserved. This program and the accompanying materials +# 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 @@ -16,7 +16,7 @@ # Import Modules # from struct import * -import os +import Common.LongFilePathOs as os import StringIO import FfsFileStatement from GenFdsGlobalVariable import GenFdsGlobalVariable @@ -47,7 +47,7 @@ class AprioriSection (AprioriSectionClassObject): # @param Dict dictionary contains macro and its value # @retval string Generated file name # - def GenFfs (self, FvName, Dict = {}): + def GenFfs (self, FvName, Dict = {}, IsMakefile = False): DXE_GUID = "FC510EE7-FFDC-11D4-BD41-0080C73C8881" PEI_GUID = "1B45CC0A-156A-428A-AF62-49864DA0E6E6" Buffer = StringIO.StringIO('') @@ -66,6 +66,7 @@ class AprioriSection (AprioriSectionClassObject): AprioriFileGuid + FvName + '.Ffs') Dict.update(self.DefineVarDict) + InfFileName = None for FfsObj in self.FfsList : Guid = "" if isinstance(FfsObj, FfsFileStatement.FileStatement): @@ -79,11 +80,11 @@ class AprioriSection (AprioriSectionClassObject): InfFileName = GenFdsGlobalVariable.MacroExtend(InfFileName, Dict, Arch) if Arch != None: - Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), Arch] + Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] Guid = Inf.Guid else: - Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), 'COMMON'] + Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] Guid = Inf.Guid self.BinFileList = Inf.Module.Binaries @@ -110,9 +111,14 @@ class AprioriSection (AprioriSectionClassObject): RawSectionFileName = os.path.join( OutputAprFilePath, \ AprioriFileGuid + FvName + '.raw' ) - GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [OutputAprFileName], 'EFI_SECTION_RAW') + MakefilePath = None + if IsMakefile: + if not InfFileName: + return None + MakefilePath = InfFileName, Arch + GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [OutputAprFileName], 'EFI_SECTION_RAW', IsMakefile=IsMakefile) GenFdsGlobalVariable.GenerateFfs(AprFfsFileName, [RawSectionFileName], - 'EFI_FV_FILETYPE_FREEFORM', AprioriFileGuid) + 'EFI_FV_FILETYPE_FREEFORM', AprioriFileGuid, MakefilePath=MakefilePath) return AprFfsFileName