mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-14 03:30:02 +00:00
25 lines
703 B
Bash
Executable File
25 lines
703 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
IMAGETAG=trezor-mcu-build
|
|
FIRMWARETAG=${1:-master}
|
|
|
|
docker build -t $IMAGETAG .
|
|
docker run -t -v $(pwd)/output:/output $IMAGETAG /bin/sh -c "\
|
|
git clone https://github.com/trezor/trezor-mcu && \
|
|
cd trezor-mcu && \
|
|
git checkout $FIRMWARETAG && \
|
|
git submodule update --init && \
|
|
CFLAGS='-std=c99' make -C vendor/libopencm3 && \
|
|
make && \
|
|
make -C firmware && \
|
|
make -C firmware sign && \
|
|
cp firmware/trezor.bin /output/trezor-$FIRMWARETAG.bin"
|
|
|
|
echo "---------------------"
|
|
echo "Firmware fingerprint:"
|
|
FILENAME=output/trezor-$FIRMWARETAG.bin
|
|
tail -c +257 "$FILENAME" | sha256sum
|
|
FILESIZE=$(stat -c%s "$FILENAME")
|
|
echo "Firmware size: $FILESIZE bytes (out of 491520 maximum)"
|