import Common.LongFilePathOs as os\r
import subprocess\r
from io import BytesIO\r
+from io import StringIO\r
from struct import *\r
\r
from . import Ffs\r
# PI FvHeader is 0x48 byte\r
FvHeaderBuffer = FvFileObj.read(0x48)\r
# FV alignment position.\r
- FvAlignmentValue = 1 << (ord(FvHeaderBuffer[0x2E]) & 0x1F)\r
+ FvAlignmentValue = 1 << (FvHeaderBuffer[0x2E] & 0x1F)\r
if FvAlignmentValue >= 0x400:\r
if FvAlignmentValue >= 0x100000:\r
if FvAlignmentValue >= 0x1000000:\r
#\r
self.InfFileName = os.path.join(GenFdsGlobalVariable.FvDir,\r
self.UiFvName + '.inf')\r
- self.FvInfFile = BytesIO()\r
+ self.FvInfFile = StringIO()\r
\r
#\r
# Add [Options]\r
GenFdsGlobalVariable.ErrorLogger("FV Extension Header Entries declared for %s with no FvNameGuid declaration." % (self.UiFvName))\r
else:\r
TotalSize = 16 + 4\r
- Buffer = ''\r
+ Buffer = bytearray()\r
if self.UsedSizeEnable:\r
TotalSize += (4 + 4)\r
## define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03\r
#\r
Buffer += (pack('HH', (FvUiLen + 16 + 4), 0x0002)\r
+ PackGUID(Guid)\r
- + self.UiFvName)\r
+ + bytes(self.UiFvName, 'utf-8'))\r
\r
for Index in range (0, len(self.FvExtEntryType)):\r
if self.FvExtEntryType[Index] == 'FILE':\r