BaseTools: Fix the bug to support generate FFS by Align=Auto

FDF spec support to use 'Auto' as <FfsAlignmentValues>, but current Tool
report error about -a=Auto is invalid option when we set Align=Auto for
RAW File.

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>
This commit is contained in:
Yonghong Zhu 2016-11-09 18:18:01 +08:00
parent ec8a387700
commit f475f1e236
1 changed files with 3 additions and 1 deletions

View File

@ -2746,6 +2746,8 @@ class FdfParser:
if self.__GetAlignment():
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
#For FFS, Auto is default option same to ""
if not self.__Token == "Auto":
AlignValue = self.__Token
if not self.__GetNextToken():
raise Warning("expected Filename value", self.FileName, self.CurrentLineNumber)