diff options
author | Rouven Czerwinski <r.czerwinski@pengutronix.de> | 2019-08-07 20:07:00 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2019-09-25 08:10:51 +0200 |
commit | bbaeed4dc6258006e846543197b8aff95d80abbf (patch) | |
tree | f790451440cbede2669ca95fc887859212daabb4 /scripts/tee_bin_parser.py | |
parent | 909c706c8c795aded2773e53f3ea6c3b5e4e8d3d (diff) |
scripts: convert remainging scripts to python3
Convert the remaining scripts to python3. Mostly done with 2to3 and
manual adjustements to the code afterwards.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Jerome Forissier <jerome@forissier.org>
Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, QEMUv8)
Diffstat (limited to 'scripts/tee_bin_parser.py')
-rwxr-xr-x | scripts/tee_bin_parser.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py index 8356ad5d..73dac8ee 100755 --- a/scripts/tee_bin_parser.py +++ b/scripts/tee_bin_parser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2016, Linaro Limited @@ -9,39 +9,39 @@ def main(): with open("../out/arm/core/tee.bin", "rb") as f: data = f.read(4) magic = struct.unpack('<I', data) - print("Magic: \t\t0x%08x" % magic) + print("Magic: \t\t0x{:08x}".format(magic)) data = f.read(1) version = struct.unpack('<B', data) - print("Version: \t0x%02x" % version) + print("Version: \t0x{:02x}".format(version)) data = f.read(1) arch_id = struct.unpack('<B', data) - print("ArchID: \t0x%02x" % arch_id) + print("ArchID: \t0x{:02x}".format(arch_id)) data = f.read(2) flags = struct.unpack('<H', data) - print("Arch Flags: \t0x%04x" % arch_id) + print("Arch Flags: \t0x{:04x}".format(arch_id)) data = f.read(4) init_size = struct.unpack('<I', data) - print("Init size: \t0x%04x" % init_size) + print("Init size: \t0x{:04x}".format(init_size)) data = f.read(4) laddr_h = struct.unpack('<I', data) - print("Load addr high:\t0x%04x" % laddr_h) + print("Load addr high:\t0x{:04x}".format(laddr_h)) data = f.read(4) laddr_l = struct.unpack('<I', data) - print("Load addr low: \t0x%04x" % laddr_l) + print("Load addr low: \t0x{:04x}".format(laddr_l)) data = f.read(4) mem_usage = struct.unpack('<I', data) - print("Mem usage: \t0x%04x" % mem_usage) + print("Mem usage: \t0x{:04x}".format(mem_usage)) data = f.read(4) pgd_size = struct.unpack('<I', data) - print("Pages size: \t0x%04x" % pgd_size) + print("Pages size: \t0x{:04x}".format(pgd_size)) if __name__ == "__main__": |