1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-03 13:08:17 +00:00
trezor-firmware/bootloader-docker-build.sh
2017-05-09 01:42:23 +02:00

25 lines
700 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 && \
export OPTFLAGS=-Os
make && \
make -C bootloader && \
cp bootloader/bootloader.bin /output/bootloader-$FIRMWARETAG.bin"
echo "---------------------"
echo "Bootloader fingerprint:"
FILENAME=output/bootloader-$FIRMWARETAG.bin
sha256sum "$FILENAME"
FILESIZE=$(stat -c%s "$FILENAME")
echo "Bootloader size: $FILESIZE bytes (out of 32768 maximum)"