Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42319 )
Change subject: util/rockchip: port make_idb.py to python3 ......................................................................
util/rockchip: port make_idb.py to python3
converted with 2to3 and manually changed shebang to reflect python3. Tested by calling the script on the command line.
Change-Id: I0e399c491ab07cd3e7fda24231cf3f7611b341e3 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M util/rockchip/make_idb.py 1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/42319/1
diff --git a/util/rockchip/make_idb.py b/util/rockchip/make_idb.py index 12cd130..4f04676 100755 --- a/util/rockchip/make_idb.py +++ b/util/rockchip/make_idb.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause
import struct @@ -7,10 +7,10 @@
class IDBTool: def __init__(self): - print "Initialize IDBTool" + print("Initialize IDBTool")
def p_rc4(self, buf, length): - key = (124,78,3,4,85,5,9,7,45,44,123,56,23,13,23,17) + key = (124, 78, 3, 4, 85, 5, 9, 7, 45, 44, 123, 56, 23, 13, 23, 17) K = key * 16 S = [i for i in range(256)]
@@ -79,7 +79,7 @@ fout.write(''.join(idblock)) fout.write(''.join(blank))
- for s in xrange(0, sectors * SECTOR_SIZE, PAGE_ALIGN * SECTOR_SIZE): + for s in range(0, sectors * SECTOR_SIZE, PAGE_ALIGN * SECTOR_SIZE): fout.write(''.join(buf[s : s + PAGE_ALIGN * SECTOR_SIZE])) fout.write(''.join(blank)) else: @@ -90,11 +90,11 @@ sys.exit("Failed to write data to : " + to_file) finally: fout.close() - print "DONE" + print("DONE")
def usage(): - print "Usage: make_idb.py [--chip=RKXX] [--enable-rc4] [--enable-align] [--to=out] --from=in" - print " --chip: default is RK32" + print("Usage: make_idb.py [--chip=RKXX] [--enable-rc4] [--enable-align] [--to=out] --from=in") + print(" --chip: default is RK32")
if __name__ == '__main__': rc4_flag = align_flag = False