1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00
trezor-firmware/bootloader/firmware_align.py
2014-10-23 18:09:41 +02:00

12 lines
233 B
Python
Executable File

#!/usr/bin/python
import sys
import os
fn = sys.argv[1]
fs = os.stat(fn).st_size
if fs > 32768:
raise Exception('bootloader has to be smaller than 32768 bytes')
with open(fn, 'ab') as f:
f.write(os.urandom(32768 - fs))
f.close()