summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds/FdfParser.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-04-01 15:20:51 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-04-05 13:24:04 +0800
commitcfaaf99bdd412139ca7b9724e678429b2f2fb45f (patch)
treeeb4e91a94a1978774da18d159d872fd69b1838c7 /BaseTools/Source/Python/GenFds/FdfParser.py
parent15f69ddfc9506dc597b771f8514161c1289a0216 (diff)
downloadedk2-platforms-cfaaf99bdd412139ca7b9724e678429b2f2fb45f.tar.xz
BaseTools/GenFds: Fix the bug for wrong alignment generate for RAW file
When do the multiple raw file support feature, it cause the regression that the raw file section alignment value was wrongly overridden by the single raw file. this patch: 1) fix the wrong overridden bug. 2) remove the duplicate code for combine multiple raw file into one. 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/Source/Python/GenFds/FdfParser.py')
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 12d4f2bb73..28af09b982 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -2716,14 +2716,13 @@ class FdfParser:
#
def __GetRAWData(self, FfsFileObj, MacroDict = {}):
FfsFileObj.FileName = []
- FfsFileObj.Alignment = []
- AlignDict = {"Auto":1, "8":8, "16":16, "32":32, "64":64, "128":128, "512":512, "1K":1024, "4K":4096, "32K":32768, "64K":65536}
+ FfsFileObj.SubAlignment = []
while True:
AlignValue = None
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)
- AlignValue = AlignValue = AlignDict[self.__Token]
+ AlignValue = self.__Token
if not self.__GetNextToken():
raise Warning("expected Filename value", self.FileName, self.CurrentLineNumber)
@@ -2735,14 +2734,14 @@ class FdfParser:
self.__VerifyFile(FileName)
File = PathClass(NormPath(FileName), GenFdsGlobalVariable.WorkSpaceDir)
FfsFileObj.FileName.append(File.Path)
- FfsFileObj.Alignment.append(AlignValue)
+ FfsFileObj.SubAlignment.append(AlignValue)
if self.__IsToken( "}"):
self.__UndoToken()
break
- if len(FfsFileObj.Alignment) == 1:
- FfsFileObj.Alignment = FfsFileObj.Alignment[0]
+ if len(FfsFileObj.SubAlignment) == 1:
+ FfsFileObj.SubAlignment = FfsFileObj.SubAlignment[0]
if len(FfsFileObj.FileName) == 1:
FfsFileObj.FileName = FfsFileObj.FileName[0]