1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

build: differentiate between models for prodtest build

This commit is contained in:
matejcik 2023-06-14 12:23:03 +02:00
parent b5b98b26eb
commit f04aff1e47

View File

@ -351,8 +351,9 @@ EOF
done
if [ "$OPT_BUILD_PRODTEST" -eq "1" ]; then
DIRSUFFIX="-prodtest"
SCRIPT_NAME=".build_prodtest.sh"
for TREZOR_MODEL in ${MODELS[@]}; do
DIRSUFFIX="-${TREZOR_MODEL}-prodtest"
SCRIPT_NAME=".build_${TREZOR_MODEL}-prodtest.sh"
cat <<EOF > "build/$SCRIPT_NAME"
# DO NOT MODIFY!
# this file was generated by ${BASH_SOURCE[0]}
@ -370,7 +371,7 @@ if [ "$OPT_BUILD_PRODTEST" -eq "1" ]; then
EOF
echo
echo ">>> DOCKER RUN core prodtest PRODUCTION=$PRODUCTION"
echo ">>> DOCKER RUN core prodtest TREZOR_MODEL=$TREZOR_MODEL PRODUCTION=$PRODUCTION"
echo
$DOCKER run \
@ -379,10 +380,12 @@ EOF
--rm \
-v "$DIR:/local" \
-v "$DIR/build/core$DIRSUFFIX":/build:z \
--env TREZOR_MODEL="$TREZOR_MODEL" \
--env PRODUCTION="$PRODUCTION" \
--init \
"$SNAPSHOT_NAME" \
/nix/var/nix/profiles/default/bin/nix-shell --run "bash /local/build/$SCRIPT_NAME"
done
fi