diff --git a/firmware/2/releases.json b/firmware/2/releases.json index 92af58c..13d5c5c 100644 --- a/firmware/2/releases.json +++ b/firmware/2/releases.json @@ -8,10 +8,10 @@ "bootloader_version": [2, 1, 6], "firmware_revision": "632b9561559b7ab6824bb7eeac072874e07b7b82", "translations": ["cs-CZ", "de-DE", "es-ES", "fr-FR"], - "url": "data/firmware/2/trezor-2.8.1.bin", + "url": "data/firmware/t2t1/trezor-t2t1-2.8.1-bitcoinonly.bin", "fingerprint": "d3af84a212d32785449ca6575e3cf2a641920b353a82dec9f059083ea5d4b149", "changelog": "* Fixed displaying of a progress indicator for the formatting operation.\n* Improve precision of PIN validation countdown.\n* Solana: Improved support for AToken Create operation.", - "url_bitcoinonly": "data/firmware/2/trezor-2.8.1-bitcoinonly.bin", + "url_bitcoinonly": "data/firmware/t2t1/trezor-t2t1-2.8.1-bitcoinonly.bin", "fingerprint_bitcoinonly": "38ab127fcf4263a18a3b07593301fdd2c6a1a96360b62c131adb849b5d18fae3", "changelog_bitcoinonly": "* Fixed displaying of a progress indicator for the formatting operation.\n* Improve precision of PIN validation countdown." }, diff --git a/firmware/2/trezor-2.8.1-bitcoinonly.bin b/firmware/2/trezor-2.8.1-bitcoinonly.bin deleted file mode 100644 index 92e4c24..0000000 --- a/firmware/2/trezor-2.8.1-bitcoinonly.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:95d4e96c77525998e4d0c9a234e2c808e275ef26505e45cbe503465e69c606c4 -size 1292800 diff --git a/firmware/2/trezor-2.8.1.bin b/firmware/2/trezor-2.8.1.bin deleted file mode 100644 index a6438d9..0000000 --- a/firmware/2/trezor-2.8.1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5289e1d5476c5097918c1d145d5a2e0a708da11d4cae13771012b8f792941b46 -size 1623552 diff --git a/scripts/check-firmware-presence-in-releases-json.sh b/scripts/check-firmware-presence-in-releases-json.sh index fb2834a..d483f8b 100755 --- a/scripts/check-firmware-presence-in-releases-json.sh +++ b/scripts/check-firmware-presence-in-releases-json.sh @@ -14,14 +14,12 @@ fi DEVICE=$1 -extract_filenames_from_json() { +extract_file_paths_from_json() { local json_file="$1" - # Filter out - # a) 'null' from missing .url_bitcoinonly for older firmwares - # b) super-old firmwares + # Filter out 'null' from missing .url_bitcoinonly for older firmwares - jq -r '.[] | select(.url) | .url, .url_bitcoinonly' "$json_file" | xargs -n1 --no-run-if-empty basename | sort | uniq \ + jq -r '.[] | select(.url) | .url, .url_bitcoinonly' "$json_file" | xargs -n1 --no-run-if-empty | sort | uniq \ | grep -vF "null" } @@ -35,11 +33,28 @@ compare_files() { local json_file="$1" local directory="$2" - expected_files=$(extract_filenames_from_json "$json_file") + # TEST 1: All files in releases.json exist + + files_in_releases_json=$(extract_file_paths_from_json "$json_file") + + for file in $files_in_releases_json; do + file_to_test="$directory/../../../$file" + if [ ! -e "$file_to_test" ]; then + echo -e "${RED}File does not exist: $file_to_test${NC}" + all_exist=false + fi + done + + if ! $all_exist ; then + exit 1 + fi + + # TEST 2: All files in directory are in releases.json + actual_files=$(list_files_in_directory "$directory") + full_path_actual_files=$(for i in $actual_files; do echo "data/firmware/${DEVICE}/${i}"; done) - missing_files=$(comm -23 <(echo "$expected_files") <(echo "$actual_files")) - extra_files=$(comm -13 <(echo "$expected_files") <(echo "$actual_files")) + extra_files=$(comm -13 <(echo "$files_in_releases_json") <(echo "$full_path_actual_files")) if [[ -z "$missing_files" && -z "$extra_files" ]]; then echo -e "${GREEN}All files are present and accounted for.${NC}"