2019-09-12 13:42:04 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-12-17 16:00:32 +00:00
|
|
|
|
|
|
|
# script/cibuild: Setup environment for CI to run tests. This is primarily
|
|
|
|
# designed to run on the continuous integration server.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
|
|
if [ "$EMULATOR" = 1 ]; then
|
|
|
|
make -C emulator
|
|
|
|
else
|
|
|
|
make -C vendor/libopencm3 lib/stm32/f2
|
|
|
|
fi
|
|
|
|
|
|
|
|
make
|
2018-06-25 16:09:52 +00:00
|
|
|
|
2018-03-22 17:53:54 +00:00
|
|
|
if [ "$EMULATOR" != 1 ]; then
|
2022-02-10 09:42:46 +00:00
|
|
|
make -C bootloader
|
2018-03-22 17:53:54 +00:00
|
|
|
fi
|
2018-06-25 16:09:52 +00:00
|
|
|
|
2020-02-11 12:05:54 +00:00
|
|
|
# invoking nanopb_generator to make sure its proto files are generated
|
2020-02-12 16:18:30 +00:00
|
|
|
nanopb_generator >/dev/null || true
|
2017-12-17 16:00:32 +00:00
|
|
|
make -C firmware/protob
|
|
|
|
|
2019-02-23 18:02:27 +00:00
|
|
|
make -C firmware
|
|
|
|
|
|
|
|
if [ "$EMULATOR" != 1 ]; then
|
|
|
|
make -C firmware sign
|
2021-04-20 20:08:01 +00:00
|
|
|
make -C intermediate_fw
|
2021-04-20 19:36:48 +00:00
|
|
|
make -C intermediate_fw sign
|
2023-03-21 14:05:18 +00:00
|
|
|
|
|
|
|
# Giving the firmware bin a descriptive name
|
|
|
|
if [ "$BITCOIN_ONLY" = 1 ]; then
|
|
|
|
BTCONLY="-bitcoinonly"
|
|
|
|
else
|
|
|
|
BTCONLY=""
|
|
|
|
fi
|
|
|
|
VERSION_MAJOR=$(grep -P '\bVERSION_MAJOR\b' firmware/version.h | cut -d' ' -f3)
|
|
|
|
VERSION_MINOR=$(grep -P '\bVERSION_MINOR\b' firmware/version.h | cut -d' ' -f3)
|
|
|
|
VERSION_PATCH=$(grep -P '\bVERSION_PATCH\b' firmware/version.h | cut -d' ' -f3)
|
|
|
|
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
|
|
|
|
GITHASH=$(git rev-parse --short HEAD)
|
|
|
|
if git status --porcelain | grep -q '.'; then
|
|
|
|
echo "There are changes in the repository."
|
|
|
|
DIRTY="-dirty"
|
|
|
|
else
|
|
|
|
DIRTY=""
|
|
|
|
fi
|
|
|
|
cp firmware/trezor.bin firmware/firmware-T1B1${BTCONLY}-${VERSION}-${GITHASH}${DIRTY}.bin
|
2019-02-23 18:02:27 +00:00
|
|
|
fi
|