2018-04-08 00:13:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2019-04-18 12:52:24 +00:00
|
|
|
cd "$(dirname $0)/.."
|
|
|
|
|
2018-06-25 16:09:52 +00:00
|
|
|
BOOTLOADER_COMMIT=${1:-HEAD}
|
|
|
|
FIRMWARE_COMMIT=${2:-HEAD}
|
2018-06-22 13:25:37 +00:00
|
|
|
|
2018-10-11 12:58:22 +00:00
|
|
|
if [ "$BOOTLOADER_COMMIT" = "EMU" ]; then
|
2019-04-18 12:52:24 +00:00
|
|
|
export EMULATOR=1
|
2018-10-11 12:58:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$EMULATOR" = 1 ]; then
|
2019-04-18 12:52:24 +00:00
|
|
|
IMAGE=trezor-mcu-emulator
|
2018-10-11 12:58:22 +00:00
|
|
|
else
|
2019-04-18 12:52:24 +00:00
|
|
|
IMAGE=trezor-mcu-build
|
2018-10-11 12:58:22 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-18 12:52:24 +00:00
|
|
|
USER=$(ls -lnd . | awk '{ print $3 }')
|
|
|
|
GROUP=$(ls -lnd . | awk '{ print $4 }')
|
|
|
|
|
|
|
|
docker build -t "$IMAGE" --build-arg EMULATOR=$EMULATOR legacy
|
|
|
|
docker run -it -v $(pwd):/src:z --user="$USER:$GROUP" "$IMAGE" \
|
|
|
|
/src/legacy/script/fullbuild "$BOOTLOADER_COMMIT" "$FIRMWARE_COMMIT"
|