aboutsummaryrefslogtreecommitdiff
path: root/system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff
diff options
context:
space:
mode:
Diffstat (limited to 'system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff')
-rw-r--r--system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff60
1 files changed, 60 insertions, 0 deletions
diff --git a/system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff b/system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff
new file mode 100644
index 0000000000000..4c9f2b6674bbe
--- /dev/null
+++ b/system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff
@@ -0,0 +1,60 @@
+--- xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/Eot/EotMain.py.orig 2019-06-06 06:51:42.000000000 +0200
++++ xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/Eot/EotMain.py 2020-12-25 20:10:44.332843625 +0100
+@@ -152,11 +152,11 @@
+ try:
+ TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
+ DecData = array('B')
+- DecData.fromstring(TmpData)
++ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
+ except:
+ TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
+ DecData = array('B')
+- DecData.fromstring(TmpData)
++ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
+
+ SectionList = []
+ Offset = 0
+@@ -196,7 +196,7 @@
+ return len(self)
+
+ def _GetUiString(self):
+- return codecs.utf_16_decode(self[0:-2].tostring())[0]
++ return codecs.utf_16_decode(self[0:-2].tobytes())[0]
+
+ String = property(_GetUiString)
+
+@@ -738,7 +738,7 @@
+ Offset = self.DataOffset - 4
+ TmpData = DeCompress('Framework', self[self.Offset:])
+ DecData = array('B')
+- DecData.fromstring(TmpData)
++ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
+ Offset = 0
+ while Offset < len(DecData):
+ Sec = Section()
+@@ -759,7 +759,7 @@
+
+ TmpData = DeCompress('Lzma', self[self.Offset:])
+ DecData = array('B')
+- DecData.fromstring(TmpData)
++ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
+ Offset = 0
+ while Offset < len(DecData):
+ Sec = Section()
+--- xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py.orig 2019-06-06 06:51:42.000000000 +0200
++++ xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 2020-12-25 20:10:39.188843812 +0100
+@@ -469,12 +469,12 @@
+ GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
+ else:
+ SectionData = array('B', [0, 0, 0, 0])
+- SectionData.fromstring(Ui.encode("utf_16_le"))
++ list(map(lambda str: SectionData.fromlist([ord(str), 0]), Ui))
+ SectionData.append(0)
+ SectionData.append(0)
+ Len = len(SectionData)
+ GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15)
+- SaveFileOnChange(Output, SectionData.tostring())
++ SaveFileOnChange(Output, SectionData.tobytes())
+
+ elif Ver:
+ Cmd += ("-n", Ver)