diff options
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index c3f36243f0..d02befec11 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -429,11 +429,18 @@ class GenFdsGlobalVariable: def GenerateFfs(Output, Input, Type, Guid, Fixed=False, CheckSum=False, Align=None,
SectionAlign=None):
Cmd = ["GenFfs", "-t", Type, "-g", Guid]
+ mFfsValidAlign = ["0", "8", "16", "128", "512", "1K", "4K", "32K", "64K"]
if Fixed == True:
Cmd += ["-x"]
if CheckSum:
Cmd += ["-s"]
if Align not in [None, '']:
+ if Align not in mFfsValidAlign:
+ Align = GenFdsGlobalVariable.GetAlignment (Align)
+ for index in range(0, len(mFfsValidAlign) - 1):
+ if ((Align > GenFdsGlobalVariable.GetAlignment(mFfsValidAlign[index])) and (Align <= GenFdsGlobalVariable.GetAlignment(mFfsValidAlign[index + 1]))):
+ break
+ Align = mFfsValidAlign[index + 1]
Cmd += ["-a", Align]
Cmd += ["-o", Output]
|