mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-19 17:46:07 +00:00
build(legacy): make bootloader_align target repeatable
[no changelog]
This commit is contained in:
parent
e81bb0f856
commit
825ccd9df5
@ -1,4 +1,4 @@
|
||||
NAME = bootloader
|
||||
NAME = bootloader-unaligned
|
||||
|
||||
OBJS += bootloader.o
|
||||
OBJS += signatures.o
|
||||
@ -44,5 +44,7 @@ include ../Makefile.include
|
||||
# Remove libtrezor from linking since we specified the small versions
|
||||
LDLIBS := $(filter-out -ltrezor,$(LDLIBS))
|
||||
|
||||
align: $(NAME).bin
|
||||
./firmware_align.py $(NAME).bin
|
||||
bootloader.bin: $(NAME).bin
|
||||
./firmware_align.py $< $@
|
||||
|
||||
all: bootloader.bin
|
||||
|
@ -5,12 +5,14 @@ import sys
|
||||
TOTALSIZE = 32768
|
||||
MAXSIZE = TOTALSIZE - 32
|
||||
|
||||
fn = sys.argv[1]
|
||||
fs = os.stat(fn).st_size
|
||||
infile = sys.argv[1]
|
||||
outfile = sys.argv[2]
|
||||
fs = os.stat(infile).st_size
|
||||
if fs > MAXSIZE:
|
||||
raise Exception(
|
||||
f"bootloader has to be smaller than {MAXSIZE} bytes (current size is {fs})"
|
||||
)
|
||||
with open(fn, "ab") as f:
|
||||
with open(outfile, "wb") as f:
|
||||
with open(infile, "rb") as i:
|
||||
f.write(i.read())
|
||||
f.write(b"\x00" * (TOTALSIZE - fs))
|
||||
f.close()
|
||||
|
@ -16,7 +16,7 @@ fi
|
||||
make
|
||||
|
||||
if [ "$EMULATOR" != 1 ]; then
|
||||
make -C bootloader align
|
||||
make -C bootloader
|
||||
fi
|
||||
|
||||
# invoking nanopb_generator to make sure its proto files are generated
|
||||
|
Loading…
Reference in New Issue
Block a user