X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FRegion.py;h=8734635fda29d0b4993a4d1655bb6d854d63ba29;hp=01e998e54c6fb6c5fa2ec1aa5c4d0f8e47622c54;hb=b21a13fbb61e0232ea98b0d7b305e24e67e50b0a;hpb=84c7452165816ed26cd5bdeb5666d4dc0026f116 diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py index 01e998e54c..8734635fda 100644 --- a/BaseTools/Source/Python/GenFds/Region.py +++ b/BaseTools/Source/Python/GenFds/Region.py @@ -1,7 +1,7 @@ ## @file # process FD Region generation # -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2015, 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 @@ -202,13 +202,20 @@ class Region(RegionClassObject): for i in range(0, Size): Buffer.write(pack('B', PadData)) - if self.RegionType == 'FILE': + if self.RegionType in ('FILE', 'INF'): for RegionData in self.RegionDataList: - RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, MacroDict) - if RegionData[1] != ':' : - RegionData = mws.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData) - if not os.path.exists(RegionData): - EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData) + if self.RegionType == 'INF': + RegionData.__InfParse__(None) + if len(RegionData.BinFileList) != 1: + EdkLogger.error('GenFds', GENFDS_ERROR, 'INF in FD region can only contain one binary: %s' % RegionData) + File = RegionData.BinFileList[0] + RegionData = RegionData.PatchEfiFile(File.Path, File.Type) + else: + RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, MacroDict) + if RegionData[1] != ':' : + RegionData = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData) + if not os.path.exists(RegionData): + EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData) # # Add the file image into FD buffer #