From 2bc3256ca6d439ebf5d85d5e74e5f3e68df14130 Mon Sep 17 00:00:00 2001 From: "Gao, Liming" Date: Fri, 10 Jan 2014 05:25:50 +0000 Subject: Sync BaseTool trunk (version r2640) into EDKII BaseTools. Signed-off-by: Gao, Liming Reviewed-by: Liu, Jiang A git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15089 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Source/Python/GenFds/GenFdsGlobalVariable.py | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py') diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index 2fa4cb8c0d..1cd31bccc3 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -65,6 +65,19 @@ class GenFdsGlobalVariable: BuildRuleFamily = "MSFT" ToolChainFamily = "MSFT" __BuildRuleDatabase = None + + # + # The list whose element are flags to indicate if large FFS or SECTION files exist in FV. + # At the beginning of each generation of FV, false flag is appended to the list, + # after the call to GenerateSection returns, check the size of the output file, + # if it is greater than 0xFFFFFF, the tail flag in list is set to true, + # and EFI_FIRMWARE_FILE_SYSTEM3_GUID is passed to C GenFv. + # At the end of generation of FV, pop the flag. + # List is used as a stack to handle nested FV generation. + # + LargeFileInFvFlags = [] + EFI_FIRMWARE_FILE_SYSTEM3_GUID = '5473C07A-3DCB-4dca-BD6F-1E9689E7349A' + LARGE_FILE_SIZE = 0x1000000 SectionHeader = struct.Struct("3B 1B") @@ -390,11 +403,13 @@ class GenFdsGlobalVariable: Cmd += Input SaveFileOnChange(CommandFile, ' '.join(Cmd), False) - if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]): - return - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input)) + if GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]): + GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input)) + GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section") - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section") + if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and + GenFdsGlobalVariable.LargeFileInFvFlags): + GenFdsGlobalVariable.LargeFileInFvFlags[-1] = True @staticmethod def GetAlignment (AlignString): @@ -432,7 +447,7 @@ class GenFdsGlobalVariable: @staticmethod def GenerateFirmwareVolume(Output, Input, BaseAddress=None, ForceRebase=None, Capsule=False, Dump=False, - AddressFile=None, MapFile=None, FfsList=[]): + AddressFile=None, MapFile=None, FfsList=[], FileSystemGuid=None): if not GenFdsGlobalVariable.NeedsUpdate(Output, Input+FfsList): return GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input)) @@ -454,6 +469,8 @@ class GenFdsGlobalVariable: Cmd += ["-a", AddressFile] if MapFile not in [None, '']: Cmd += ["-m", MapFile] + if FileSystemGuid: + Cmd += ["-g", FileSystemGuid] Cmd += ["-o", Output] for I in Input: Cmd += ["-i", I] -- cgit v1.2.3