bootloader autobuild in docker

This commit is contained in:
karek314 2016-02-19 00:24:33 +01:00 committed by Pavol Rusnak
parent a7ef132ce5
commit da027f7652
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 36 additions and 3 deletions

View File

@ -8,13 +8,23 @@ http://bitcointrezor.com/
How to build TREZOR firmware?
-----------------------------
1. Install Docker (from docker.com or from your distribution repositories)
1. <a href="https://docs.docker.com/engine/installation/">Install Docker</a>
2. `git clone https://github.com/trezor/trezor-mcu.git`
3. `cd trezor-mcu`
4. `./firmware-docker-build.sh TAG` (where TAG is v1.3.2 for example, if left blank the script builds latest commit)
This creates file `output/trezor-TAG.bin` and prints its fingerprint at the last line of the build log.
How to build TREZOR bootloader?
-----------------------------
1. <a href="https://docs.docker.com/engine/installation/">Install Docker</a>
2. `git clone https://github.com/trezor/trezor-mcu.git`
3. `cd trezor-mcu`
4. `./bootloader-docker-build.sh`
This creates file `output/bootloader.bin` and prints its fingerprint and size at the last line of the build log.
How to get fingerprint of firmware signed and distributed by SatoshiLabs?
-------------------------------------------------------------------------

21
bootloader-docker-build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
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 && \
make -C vendor/libopencm3 && \
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)"

View File

@ -15,5 +15,7 @@ docker run -t -v $(pwd)/output:/output $IMAGETAG /bin/sh -c "\
echo "---------------------"
echo "Firmware fingerprint:"
sha256sum output/trezor-$FIRMWARETAG.bin
FILENAME=output/trezor-$FIRMWARETAG.bin
sha256sum "$FILENAME"
FILESIZE=$(stat -c%s "$FILENAME")
echo "Firmware size: $FILESIZE bytes (out of 491520 maximum)"