mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
Tools for deterministic builds and firmware comparing
This commit is contained in:
parent
23bae6ec9d
commit
92b6b8caf1
24
docker-build.sh
Executable file
24
docker-build.sh
Executable 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
11
firmware-fingerprint.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user