summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-12-27 17:52:12 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-12-29 16:58:17 +0800
commitd2192f12b2d0b93416ff63ac73a3276a07d26c9e (patch)
tree3bd24a004e5a3eb7c24f1dcc77f4bd8220cb82fe /BaseTools
parent63022be1e5c9c5a1971fcb99e64eefaa338c5a06 (diff)
downloadedk2-d2192f12b2d0b93416ff63ac73a3276a07d26c9e.zip
edk2-d2192f12b2d0b93416ff63ac73a3276a07d26c9e.tar.gz
edk2-d2192f12b2d0b93416ff63ac73a3276a07d26c9e.tar.bz2
BaseTools: Fix the bug for RAW file alignment value support
Fix the bug for RAW file to support Align=32 and Align=64. Current FDF spec FfsAlignmentValues support this two values, while it is not the valid value for GenFfs. So this patch add the logic to handle it. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=248 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index c3f3624..d02befe 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]