From 0b3d0c66816c980cee64971cc70b636ba9037fb8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 23 Jan 2020 13:01:03 +0100 Subject: [PATCH] legacy/bootloader: update combine script --- legacy/bootloader/combine/prepare.py | 11 +++++------ legacy/bootloader/firmware_sign.py | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/legacy/bootloader/combine/prepare.py b/legacy/bootloader/combine/prepare.py index 7918e063e1..f2b3e952db 100755 --- a/legacy/bootloader/combine/prepare.py +++ b/legacy/bootloader/combine/prepare.py @@ -1,11 +1,10 @@ -#!/usr/bin/env python -from __future__ import print_function +#!/usr/bin/env python3 -bl = open("bl.bin").read() -fw = open("fw.bin").read() -combined = bl + fw[:256] + (32768 - 256) * "\x00" + fw[256:] +bl = open("bl.bin", "rb").read() +fw = open("fw.bin", "rb").read() +combined = bl + 32768 * b"\xff" + fw -open("combined.bin", "w").write(combined) +open("combined.bin", "wb").write(combined) print("bootloader : %d bytes" % len(bl)) print("firmware : %d bytes" % len(fw)) diff --git a/legacy/bootloader/firmware_sign.py b/legacy/bootloader/firmware_sign.py index 948a08f993..408fdd058b 100755 --- a/legacy/bootloader/firmware_sign.py +++ b/legacy/bootloader/firmware_sign.py @@ -1,6 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function - import argparse import hashlib import struct