2017-07-24 17:44:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
IMAGE=trezor-mcu-build
|
|
|
|
TAG=${1:-master}
|
|
|
|
BINFILE=build/trezor-$TAG.bin
|
2017-08-16 16:25:55 +00:00
|
|
|
ELFFILE=build/trezor-$TAG.elf
|
2017-07-24 17:44:10 +00:00
|
|
|
|
|
|
|
docker build -t $IMAGE .
|
2017-08-10 14:58:52 +00:00
|
|
|
docker run -t -v $(pwd)/build:/build:z $IMAGE /bin/sh -c "\
|
2017-07-24 17:44:10 +00:00
|
|
|
git clone https://github.com/trezor/trezor-mcu && \
|
|
|
|
cd trezor-mcu && \
|
|
|
|
git checkout $TAG && \
|
|
|
|
git submodule update --init && \
|
2017-08-28 11:47:15 +00:00
|
|
|
make -C vendor/libopencm3 && \
|
2017-09-28 11:10:32 +00:00
|
|
|
make -C vendor/nanopb/generator/proto && \
|
|
|
|
make -C firmware/protob && \
|
2017-07-24 17:44:10 +00:00
|
|
|
make && \
|
|
|
|
make -C firmware sign && \
|
2017-08-16 16:25:55 +00:00
|
|
|
cp firmware/trezor.bin /$BINFILE && \
|
|
|
|
cp firmware/trezor.elf /$ELFFILE"
|
2017-07-24 17:44:10 +00:00
|
|
|
|
|
|
|
/usr/bin/env python -c "
|
|
|
|
from __future__ import print_function
|
|
|
|
import hashlib
|
|
|
|
import sys
|
|
|
|
fn = sys.argv[1]
|
|
|
|
data = open(fn, 'rb').read()
|
|
|
|
print('\n\n')
|
|
|
|
print('Filename :', fn)
|
|
|
|
print('Fingerprint :', hashlib.sha256(data[256:]).hexdigest())
|
|
|
|
print('Size : %d bytes (out of %d maximum)' % (len(data), 491520))
|
|
|
|
" $BINFILE
|