##\r
# Import Modules\r
#\r
+from __future__ import absolute_import\r
from . import Section\r
from io import BytesIO\r
-from .Ffs import Ffs\r
+from .Ffs import SectionSuffix\r
import subprocess\r
from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
import Common.LongFilePathOs as os\r
if FvAlignmentValue > MaxFvAlignment:\r
MaxFvAlignment = FvAlignmentValue\r
\r
- OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get("FV_IMAGE"))\r
+ OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + SectionSuffix.get("FV_IMAGE"))\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE', IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
# Generate Fv\r
#\r
if self.FvName is not None:\r
- Buffer = BytesIO()\r
+ Buffer = BytesIO('')\r
Fv = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName)\r
if Fv is not None:\r
self.Fv = Fv\r
# PI FvHeader is 0x48 byte\r
FvHeaderBuffer = FvFileObj.read(0x48)\r
# FV alignment position.\r
- FvAlignmentValue = 1 << (FvHeaderBuffer[0x2E] & 0x1F)\r
+ FvAlignmentValue = 1 << (ord (FvHeaderBuffer[0x2E]) & 0x1F)\r
# FvAlignmentValue is larger than or equal to 1K\r
if FvAlignmentValue >= 0x400:\r
if FvAlignmentValue >= 0x100000:\r
#\r
# Prepare the parameter of GenSection\r
#\r
- OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + Ffs.SectionSuffix.get("FV_IMAGE"))\r
+ OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + SectionSuffix.get("FV_IMAGE"))\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE', IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r