2014-06-19 00:08:31 +00:00
|
|
|
#!/bin/bash
|
2016-07-03 11:53:20 +00:00
|
|
|
set -e
|
|
|
|
|
2014-07-07 14:59:37 +00:00
|
|
|
IMAGETAG=trezor-mcu-build
|
2015-07-04 11:49:30 +00:00
|
|
|
FIRMWARETAG=${1:-master}
|
2014-12-25 13:43:32 +00:00
|
|
|
|
2014-07-07 14:59:37 +00:00
|
|
|
docker build -t $IMAGETAG .
|
2015-03-05 21:09:30 +00:00
|
|
|
docker run -t -v $(pwd)/output:/output $IMAGETAG /bin/sh -c "\
|
2015-07-04 11:49:30 +00:00
|
|
|
git clone https://github.com/trezor/trezor-mcu && \
|
2014-12-27 15:33:44 +00:00
|
|
|
cd trezor-mcu && \
|
|
|
|
git checkout $FIRMWARETAG && \
|
|
|
|
git submodule update --init && \
|
2017-05-08 23:42:23 +00:00
|
|
|
CFLAGS='-std=c99' make -C vendor/libopencm3 && \
|
2015-12-14 23:20:34 +00:00
|
|
|
make && \
|
2015-12-14 23:30:10 +00:00
|
|
|
make -C firmware && \
|
2016-08-29 17:20:50 +00:00
|
|
|
make -C firmware sign && \
|
2015-12-14 23:30:10 +00:00
|
|
|
cp firmware/trezor.bin /output/trezor-$FIRMWARETAG.bin"
|
2014-06-19 00:08:31 +00:00
|
|
|
|
2014-06-19 00:28:22 +00:00
|
|
|
echo "---------------------"
|
|
|
|
echo "Firmware fingerprint:"
|
2016-02-18 23:24:33 +00:00
|
|
|
FILENAME=output/trezor-$FIRMWARETAG.bin
|
2016-08-29 17:20:50 +00:00
|
|
|
tail -c +257 "$FILENAME" | sha256sum
|
2016-02-18 23:24:33 +00:00
|
|
|
FILESIZE=$(stat -c%s "$FILENAME")
|
|
|
|
echo "Firmware size: $FILESIZE bytes (out of 491520 maximum)"
|