diff options
author | Liming Gao <liming.gao@intel.com> | 2013-08-23 02:18:16 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-08-23 02:18:16 +0000 |
commit | 4afd3d042215afe68d00b9ab8c32f063a3a1c03f (patch) | |
tree | b5190bd11547ac22fe35eeceee85ef42bfe6eea5 /BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | |
parent | a365eed476687881ce0ed49af7d483fd3cb0c491 (diff) | |
download | edk2-4afd3d042215afe68d00b9ab8c32f063a3a1c03f.tar.gz edk2-4afd3d042215afe68d00b9ab8c32f063a3a1c03f.tar.bz2 edk2-4afd3d042215afe68d00b9ab8c32f063a3a1c03f.zip |
Sync BaseTool trunk (version r2599) into EDKII BaseTools.
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Heshen Chen <chen.heshen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14591 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index b457937628..2fa4cb8c0d 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -345,7 +345,7 @@ class GenFdsGlobalVariable: @staticmethod def GenerateSection(Output, Input, Type=None, CompressionType=None, Guid=None, - GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None): + GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None, BuildNumber=None): Cmd = ["GenSec"] if Type not in [None, '']: Cmd += ["-s", Type] @@ -364,6 +364,7 @@ class GenFdsGlobalVariable: for SecAlign in InputAlign: Cmd += ["--sectionalign", SecAlign] + CommandFile = Output + '.txt' if Ui not in [None, '']: #Cmd += ["-n", '"' + Ui + '"'] SectionData = array.array('B', [0,0,0,0]) @@ -374,19 +375,20 @@ class GenFdsGlobalVariable: GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15) SaveFileOnChange(Output, SectionData.tostring()) elif Ver not in [None, '']: - #Cmd += ["-j", Ver] - SectionData = array.array('B', [0,0,0,0]) - SectionData.fromstring(Ver.encode("utf_16_le")) - SectionData.append(0) - SectionData.append(0) - Len = len(SectionData) - GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x14) - SaveFileOnChange(Output, SectionData.tostring()) + Cmd += ["-n", Ver] + if BuildNumber: + Cmd += ["-j", BuildNumber] + Cmd += ["-o", Output] + + SaveFileOnChange(CommandFile, ' '.join(Cmd), False) + if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]): + return + + GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section") else: Cmd += ["-o", Output] Cmd += Input - CommandFile = Output + '.txt' SaveFileOnChange(CommandFile, ' '.join(Cmd), False) if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]): return |