1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

Tools for deterministic builds and firmware comparing

This commit is contained in:
slush0 2014-06-19 02:08:31 +02:00
parent 23bae6ec9d
commit 92b6b8caf1
2 changed files with 35 additions and 0 deletions

24
docker-build.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
dirname $0
# Build trezor firmware
docker build . | tee docker.log
# Parse image name
IMAGE=`grep "Successfully built" docker.log | tail -n1 | cut -d' ' -f3`
echo "IMAGE NAME: $IMAGE"
docker run -t $IMAGE true
# Parse container name
CONTAINER=`docker ps -a | grep true | head -n1 | cut -d' ' -f1`
echo "CONTAINER NAME: $CONTAINER"
docker cp $CONTAINER:/trezor-mcu/firmware/trezor.bin .
echo "-------------------------"
echo ""
echo "SHA256 hash:"
sha256sum trezor.bin

11
firmware-fingerprint.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
MAGIC=`head -c +4 $1`
if [ "x$MAGIC" != "xTRZR" ]; then
echo "Missing magic characters 'TRZR', invalid firmware"
exit 1
fi
echo "Firmware fingerprint:"
tail -c +257 $1 | sha256sum