1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-29 09:38:08 +00:00
trezor-firmware/bootloader/firmware_align.py

12 lines
237 B
Python
Raw Normal View History

2017-02-01 17:07:47 +00:00
#!/usr/bin/env python
2014-10-23 16:09:41 +00:00
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:
2017-07-19 10:52:36 +00:00
f.write(b'\xFF' * (32768 - fs))
2014-10-23 16:09:41 +00:00
f.close()