Skip to content

Commit

Permalink
chore: trying something out
Browse files Browse the repository at this point in the history
  • Loading branch information
vdovhanych committed Aug 7, 2024
1 parent e192365 commit 455f854
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 92 deletions.
65 changes: 0 additions & 65 deletions docker/Dockerfile

This file was deleted.

Binary file removed docker/alpine-minirootfs-3.15.0-x86_64.tar.gz
Binary file not shown.
10 changes: 0 additions & 10 deletions patch_emulators.sh

This file was deleted.

6 changes: 3 additions & 3 deletions src/binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
IS_ARM = os.uname().machine.startswith(("aarch64", "arm"))
ARM_IDENTIFIER = "-arm"

IDENTIFIER_T1B1 = "trezor-emu-legacy-v"
IDENTIFIER_T2T1 = "trezor-emu-core-v"
IDENTIFIER_T2B1 = "trezor-emu-core-R-v"
IDENTIFIER_T1B1 = "trezor-emu-legacy-T1B1-v"
IDENTIFIER_T2T1 = "trezor-emu-core-T2T1-v"
IDENTIFIER_T2B1 = "trezor-emu-core-T2B1-v"
IDENTIFIER_T3T1 = "trezor-emu-core-T3T1-v"


Expand Down
67 changes: 53 additions & 14 deletions src/binaries/firmware/bin/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,67 @@ SYSTEM_ARCH=$(uname -m)

cd "$(dirname "${BASH_SOURCE[0]}")"
BIN_DIR=$(pwd)
base_url="https://data.trezor.io/dev/firmware/releases/emulators-new"

if [[ $SYSTEM_ARCH == x86_64* ]]; then
SITE="https://data.trezor.io/dev/firmware/releases/emulators/"
CUT_DIRS=4
suffix=""

elif [[ $SYSTEM_ARCH == aarch64* ]]; then
SITE="https://data.trezor.io/dev/firmware/releases/emulators/arm/"
CUT_DIRS=5
suffix="-arm"

else
echo "Not a supported arch - $SYSTEM_ARCH"
exit 1
fi

if ! wget --no-config -e robots=off --no-verbose --no-clobber --no-parent --cut-dirs=$CUT_DIRS --no-host-directories --recursive --reject "index.html*" "$SITE"; then
echo "Unable to fetch released emulators from $SITE"
echo "You will have only available latest builds from CI"
echo
fi
# if ! wget --no-config -e robots=off --no-verbose --no-clobber --no-parent --cut-dirs=$CUT_DIRS --no-host-directories --recursive --reject "index.html*" "$SITE"; then
# echo "Unable to fetch released emulators from $SITE"
# echo "You will have only available latest builds from CI"
# echo
# fi

# Define the emulators to download latest 10 versions
files=(
# T1B1
"T1B1/trezor-emu-legacy-T1B1-v1.10.0${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.10.1${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.10.2${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.10.3${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.10.4${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.10.5${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.11.1${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.11.2${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.12.0${suffix}"
"T1B1/trezor-emu-legacy-T1B1-v1.12.1${suffix}"
# T2T1
"T2T1/trezor-emu-core-T2T1-v2.5.1${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.5.2${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.5.3${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.6.1${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.6.2${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.6.3${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.7.1${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.7.2${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.8.0${suffix}"
"T2T1/trezor-emu-core-T2T1-v2.8.1${suffix}"
# T2B1
"T2B1/trezor-emu-core-T2B1-v2.7.0${suffix}"
"T2B1/trezor-emu-core-T2B1-v2.7.1${suffix}"
"T2B1/trezor-emu-core-T2B1-v2.7.2${suffix}"
"T2B1/trezor-emu-core-T2B1-v2.8.0${suffix}"
"T2B1/trezor-emu-core-T2B1-v2.8.1${suffix}"
# T3T1
"T3T1/trezor-emu-core-T3T1-v2.8.0${suffix}"
"T3T1/trezor-emu-core-T3T1-v2.8.1${suffix}"
)

for file in "${files[@]}"; do
wget "${base_url}/${file}" || true
done

# download emulator from main
TMP_DIR="$BIN_DIR/tmp"
Expand All @@ -38,32 +80,29 @@ trap cleanup EXIT

cd "$TMP_DIR"

# NOTE: when unziping, using -o to overwrite existing files,
# otherwise extracting TR into already existing TT will ask for confirmation

if [[ $SYSTEM_ARCH == x86_64* ]]; then
wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-legacy-T1B1-universal
mv trezor-emu-legacy-T1B1-universal ../trezor-emu-legacy-v1-main
mv trezor-emu-legacy-T1B1-universal ../trezor-emu-legacy-T1B1-v1-main

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-core-T2T1-universal
mv trezor-emu-core-T2T1-universal ../trezor-emu-core-v2-main
mv trezor-emu-core-T2T1-universal ../trezor-emu-core-T2T1-v2-main

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-core-T2B1-universal
mv trezor-emu-core-T2B1-universal ../trezor-emu-core-R-v2-main
mv trezor-emu-core-T2B1-universal ../trezor-emu-T2B1-v2-main

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-core-T3T1-universal
mv trezor-emu-core-T3T1-universal ../trezor-emu-core-T3T1-v2-main

elif [[ $SYSTEM_ARCH == aarch64* ]]; then

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-legacy-T1B1-universal
mv trezor-emu-arm-legacy-T1B1-universal ../trezor-emu-legacy-v1-main-arm
mv trezor-emu-arm-legacy-T1B1-universal ../trezor-emu-legacy-T1B1-v1-main-arm

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-core-T2T1-universal
mv trezor-emu-arm-core-T2T1-universal ../trezor-emu-core-v2-main-arm
mv trezor-emu-arm-core-T2T1-universal ../trezor-emu-core-T2T1-v2-main-arm

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-core-T2B1-universal
mv trezor-emu-arm-core-T2B1-universal ../trezor-emu-core-R-v2-main-arm
mv trezor-emu-arm-core-T2B1-universal ../trezor-emu-core-T2B1-v2-main-arm

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-core-T3T1-universal
mv trezor-emu-arm-core-T3T1-universal ../trezor-emu-core-T3T1-v2-main-arm
Expand Down

0 comments on commit 455f854

Please sign in to comment.