diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-04-01 15:20:51 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-04-05 13:24:04 +0800 |
commit | cfaaf99bdd412139ca7b9724e678429b2f2fb45f (patch) | |
tree | eb4e91a94a1978774da18d159d872fd69b1838c7 /BaseTools/Source/Python/GenFds/Fv.py | |
parent | 15f69ddfc9506dc597b771f8514161c1289a0216 (diff) | |
download | edk2-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/Fv.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/Fv.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py index e385ccb1b5..64d1709946 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -112,34 +112,6 @@ class FV (FvClassObject): # Process Modules in FfsList
for FfsFile in self.FfsList :
- if hasattr(FfsFile, 'FvFileType') and FfsFile.FvFileType == 'RAW':
- if isinstance(FfsFile.FileName, list) and isinstance(FfsFile.Alignment, list) and len(FfsFile.FileName) == len(FfsFile.Alignment):
- FileContent = ''
- for Index, File in enumerate(FfsFile.FileName):
- try:
- f = open(File, 'r+b')
- except:
- GenFdsGlobalVariable.ErrorLogger("Error opening RAW file %s." % (File))
- Content = f.read()
- f.close()
- AlignValue = FfsFile.Alignment[Index]
- if AlignValue == None:
- AlignValue = 1
- FileContent += Content
- if len(FileContent) % AlignValue != 0:
- Size = AlignValue - len(FileContent) % AlignValue
- for i in range(0, Size):
- FileContent += pack('B', 0xFF)
-
- if FileContent:
- OutputRAWFile = os.path.join(GenFdsGlobalVariable.FfsDir, FfsFile.NameGuid, FfsFile.NameGuid + '.raw')
- SaveFileOnChange(OutputRAWFile, FileContent, True)
- FfsFile.FileName = OutputRAWFile
- if max(FfsFile.Alignment):
- FfsFile.Alignment = str(max(FfsFile.Alignment))
- else:
- FfsFile.Alignment = None
-
FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress)
FfsFileList.append(FileName)
self.FvInfFile.writelines("EFI_FILE_NAME = " + \
|