diff --git a/Makefile b/Makefile index 04503bf02..ff9f99692 100644 --- a/Makefile +++ b/Makefile @@ -143,10 +143,10 @@ docs_summary_check: ## check if there are unlinked documentation files python3 tools/check_docs_summary.py vendorheader: ## generate vendor header - ./core/embed/vendorheader/generate.sh --quiet + ./core/tools/generate_vendorheader.sh --quiet vendorheader_check: ## check that vendor header is up to date - ./core/embed/vendorheader/generate.sh --quiet --check + ./core/tools/generate_vendorheader.sh --quiet --check gen: templates mocks icons protobuf ci_docs vendorheader solana_templates ## regenerate auto-generated files from sources diff --git a/core/SConscript.firmware b/core/SConscript.firmware index 22e0a591e..3097e73bb 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -892,7 +892,7 @@ else: else: vendor = "trezor_signed_prod" -VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_{vendor}.bin' +VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/vendorheader_{vendor}.bin' if TREZOR_MODEL not in ('1',): diff --git a/core/SConscript.prodtest b/core/SConscript.prodtest index 8f5a5d62b..b505b4337 100644 --- a/core/SConscript.prodtest +++ b/core/SConscript.prodtest @@ -227,13 +227,13 @@ elif (vh := os.environ.get("VENDOR_HEADER", None)): # of vendor header which does not affect reproducibility of the build. Nonetheless, # we should figure out a cleaner way to pass in this argument, without having to teach # the Makefile about it. - VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/{vh}' + VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/{vh}' elif PRODUCTION: - VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_prodtest_signed_prod.bin' + VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/vendorheader_prodtest_signed_prod.bin' elif BOOTLOADER_DEVEL: - VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin' + VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin' else: - VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_unsafe_signed_prod.bin' + VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/vendorheader_unsafe_signed_prod.bin' diff --git a/core/SConscript.reflash b/core/SConscript.reflash index e40af8b1e..dccc9e66f 100644 --- a/core/SConscript.reflash +++ b/core/SConscript.reflash @@ -182,7 +182,7 @@ obj_program += env.Object(source=SOURCE_HAL) MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL) -VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_' + ('unsafe_signed_dev.bin' if ARGUMENTS.get('PRODUCTION', '0') == '0' else 'satoshilabs_signed_prod.bin') +VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/vendorheader_' + ('unsafe_signed_dev.bin' if ARGUMENTS.get('PRODUCTION', '0') == '0' else 'satoshilabs_signed_prod.bin') obj_program.extend( env.Command( diff --git a/core/embed/vendorheader/D001/vendor_dev_DO_NOT_SIGN.json b/core/embed/models/D001/vendorheader/vendor_dev_DO_NOT_SIGN.json similarity index 100% rename from core/embed/vendorheader/D001/vendor_dev_DO_NOT_SIGN.json rename to core/embed/models/D001/vendorheader/vendor_dev_DO_NOT_SIGN.json diff --git a/core/embed/vendorheader/D001/vendor_dev_DO_NOT_SIGN.toif b/core/embed/models/D001/vendorheader/vendor_dev_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/D001/vendor_dev_DO_NOT_SIGN.toif rename to core/embed/models/D001/vendorheader/vendor_dev_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/D001/vendor_unsafe.json b/core/embed/models/D001/vendorheader/vendor_unsafe.json similarity index 100% rename from core/embed/vendorheader/D001/vendor_unsafe.json rename to core/embed/models/D001/vendorheader/vendor_unsafe.json diff --git a/core/embed/vendorheader/D001/vendor_unsafe.toif b/core/embed/models/D001/vendorheader/vendor_unsafe.toif similarity index 100% rename from core/embed/vendorheader/D001/vendor_unsafe.toif rename to core/embed/models/D001/vendorheader/vendor_unsafe.toif diff --git a/core/embed/vendorheader/D001/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin b/core/embed/models/D001/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/D001/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin rename to core/embed/models/D001/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin diff --git a/core/embed/vendorheader/D001/vendorheader_dev_DO_NOT_SIGN_unsigned.bin b/core/embed/models/D001/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin similarity index 100% rename from core/embed/vendorheader/D001/vendorheader_dev_DO_NOT_SIGN_unsigned.bin rename to core/embed/models/D001/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin diff --git a/core/embed/vendorheader/D001/vendorheader_unsafe_signed_dev.bin b/core/embed/models/D001/vendorheader/vendorheader_unsafe_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/D001/vendorheader_unsafe_signed_dev.bin rename to core/embed/models/D001/vendorheader/vendorheader_unsafe_signed_dev.bin diff --git a/core/embed/vendorheader/D001/vendorheader_unsafe_signed_prod.bin b/core/embed/models/D001/vendorheader/vendorheader_unsafe_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/D001/vendorheader_unsafe_signed_prod.bin rename to core/embed/models/D001/vendorheader/vendorheader_unsafe_signed_prod.bin diff --git a/core/embed/vendorheader/D001/vendorheader_unsafe_unsigned.bin b/core/embed/models/D001/vendorheader/vendorheader_unsafe_unsigned.bin similarity index 100% rename from core/embed/vendorheader/D001/vendorheader_unsafe_unsigned.bin rename to core/embed/models/D001/vendorheader/vendorheader_unsafe_unsigned.bin diff --git a/core/embed/vendorheader/D002/vendor_dev_DO_NOT_SIGN.json b/core/embed/models/D002/vendorheader/vendor_dev_DO_NOT_SIGN.json similarity index 100% rename from core/embed/vendorheader/D002/vendor_dev_DO_NOT_SIGN.json rename to core/embed/models/D002/vendorheader/vendor_dev_DO_NOT_SIGN.json diff --git a/core/embed/vendorheader/D002/vendor_dev_DO_NOT_SIGN.toif b/core/embed/models/D002/vendorheader/vendor_dev_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/D002/vendor_dev_DO_NOT_SIGN.toif rename to core/embed/models/D002/vendorheader/vendor_dev_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/D002/vendor_unsafe.json b/core/embed/models/D002/vendorheader/vendor_unsafe.json similarity index 100% rename from core/embed/vendorheader/D002/vendor_unsafe.json rename to core/embed/models/D002/vendorheader/vendor_unsafe.json diff --git a/core/embed/vendorheader/D002/vendor_unsafe.toif b/core/embed/models/D002/vendorheader/vendor_unsafe.toif similarity index 100% rename from core/embed/vendorheader/D002/vendor_unsafe.toif rename to core/embed/models/D002/vendorheader/vendor_unsafe.toif diff --git a/core/embed/vendorheader/D002/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin b/core/embed/models/D002/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/D002/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin rename to core/embed/models/D002/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin diff --git a/core/embed/vendorheader/D002/vendorheader_dev_DO_NOT_SIGN_unsigned.bin b/core/embed/models/D002/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin similarity index 100% rename from core/embed/vendorheader/D002/vendorheader_dev_DO_NOT_SIGN_unsigned.bin rename to core/embed/models/D002/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin diff --git a/core/embed/vendorheader/D002/vendorheader_unsafe_signed_dev.bin b/core/embed/models/D002/vendorheader/vendorheader_unsafe_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/D002/vendorheader_unsafe_signed_dev.bin rename to core/embed/models/D002/vendorheader/vendorheader_unsafe_signed_dev.bin diff --git a/core/embed/vendorheader/D002/vendorheader_unsafe_unsigned.bin b/core/embed/models/D002/vendorheader/vendorheader_unsafe_unsigned.bin similarity index 100% rename from core/embed/vendorheader/D002/vendorheader_unsafe_unsigned.bin rename to core/embed/models/D002/vendorheader/vendorheader_unsafe_unsigned.bin diff --git a/core/embed/vendorheader/T2B1/vendor_dev_DO_NOT_SIGN.json b/core/embed/models/T2B1/vendorheader/vendor_dev_DO_NOT_SIGN.json similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_dev_DO_NOT_SIGN.json rename to core/embed/models/T2B1/vendorheader/vendor_dev_DO_NOT_SIGN.json diff --git a/core/embed/vendorheader/T2B1/vendor_dev_DO_NOT_SIGN.toif b/core/embed/models/T2B1/vendorheader/vendor_dev_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_dev_DO_NOT_SIGN.toif rename to core/embed/models/T2B1/vendorheader/vendor_dev_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/T2B1/vendor_prodtest.json b/core/embed/models/T2B1/vendorheader/vendor_prodtest.json similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_prodtest.json rename to core/embed/models/T2B1/vendorheader/vendor_prodtest.json diff --git a/core/embed/vendorheader/T2B1/vendor_prodtest.toif b/core/embed/models/T2B1/vendorheader/vendor_prodtest.toif similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_prodtest.toif rename to core/embed/models/T2B1/vendorheader/vendor_prodtest.toif diff --git a/core/embed/vendorheader/T2B1/vendor_trezor.json b/core/embed/models/T2B1/vendorheader/vendor_trezor.json similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_trezor.json rename to core/embed/models/T2B1/vendorheader/vendor_trezor.json diff --git a/core/embed/vendorheader/T2B1/vendor_trezor.toif b/core/embed/models/T2B1/vendorheader/vendor_trezor.toif similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_trezor.toif rename to core/embed/models/T2B1/vendorheader/vendor_trezor.toif diff --git a/core/embed/vendorheader/T2B1/vendor_trezor_btconly.json b/core/embed/models/T2B1/vendorheader/vendor_trezor_btconly.json similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_trezor_btconly.json rename to core/embed/models/T2B1/vendorheader/vendor_trezor_btconly.json diff --git a/core/embed/vendorheader/T2B1/vendor_trezor_btconly.toif b/core/embed/models/T2B1/vendorheader/vendor_trezor_btconly.toif similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_trezor_btconly.toif rename to core/embed/models/T2B1/vendorheader/vendor_trezor_btconly.toif diff --git a/core/embed/vendorheader/T2B1/vendor_unsafe.json b/core/embed/models/T2B1/vendorheader/vendor_unsafe.json similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_unsafe.json rename to core/embed/models/T2B1/vendorheader/vendor_unsafe.json diff --git a/core/embed/vendorheader/T2B1/vendor_unsafe.toif b/core/embed/models/T2B1/vendorheader/vendor_unsafe.toif similarity index 100% rename from core/embed/vendorheader/T2B1/vendor_unsafe.toif rename to core/embed/models/T2B1/vendorheader/vendor_unsafe.toif diff --git a/core/embed/vendorheader/T2B1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin b/core/embed/models/T2B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin b/core/embed/models/T2B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_prodtest_signed_prod.bin b/core/embed/models/T2B1/vendorheader/vendorheader_prodtest_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_prodtest_signed_prod.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_prodtest_signed_prod.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_prodtest_unsigned.bin b/core/embed/models/T2B1/vendorheader/vendorheader_prodtest_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_prodtest_unsigned.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_prodtest_unsigned.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_trezor_btconly_signed_prod.bin b/core/embed/models/T2B1/vendorheader/vendorheader_trezor_btconly_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_trezor_btconly_signed_prod.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_trezor_btconly_signed_prod.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_trezor_btconly_unsigned.bin b/core/embed/models/T2B1/vendorheader/vendorheader_trezor_btconly_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_trezor_btconly_unsigned.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_trezor_btconly_unsigned.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_trezor_signed_prod.bin b/core/embed/models/T2B1/vendorheader/vendorheader_trezor_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_trezor_signed_prod.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_trezor_signed_prod.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_trezor_unsigned.bin b/core/embed/models/T2B1/vendorheader/vendorheader_trezor_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_trezor_unsigned.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_trezor_unsigned.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_unsafe_signed_dev.bin b/core/embed/models/T2B1/vendorheader/vendorheader_unsafe_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_unsafe_signed_dev.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_unsafe_signed_dev.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_unsafe_signed_prod.bin b/core/embed/models/T2B1/vendorheader/vendorheader_unsafe_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_unsafe_signed_prod.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_unsafe_signed_prod.bin diff --git a/core/embed/vendorheader/T2B1/vendorheader_unsafe_unsigned.bin b/core/embed/models/T2B1/vendorheader/vendorheader_unsafe_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2B1/vendorheader_unsafe_unsigned.bin rename to core/embed/models/T2B1/vendorheader/vendorheader_unsafe_unsigned.bin diff --git a/core/embed/vendorheader/T2T1/vendor_dev_DO_NOT_SIGN.json b/core/embed/models/T2T1/vendorheader/vendor_dev_DO_NOT_SIGN.json similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_dev_DO_NOT_SIGN.json rename to core/embed/models/T2T1/vendorheader/vendor_dev_DO_NOT_SIGN.json diff --git a/core/embed/vendorheader/T2T1/vendor_dev_DO_NOT_SIGN.toif b/core/embed/models/T2T1/vendorheader/vendor_dev_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_dev_DO_NOT_SIGN.toif rename to core/embed/models/T2T1/vendorheader/vendor_dev_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/T2T1/vendor_prodtest.json b/core/embed/models/T2T1/vendorheader/vendor_prodtest.json similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_prodtest.json rename to core/embed/models/T2T1/vendorheader/vendor_prodtest.json diff --git a/core/embed/vendorheader/T2T1/vendor_prodtest.toif b/core/embed/models/T2T1/vendorheader/vendor_prodtest.toif similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_prodtest.toif rename to core/embed/models/T2T1/vendorheader/vendor_prodtest.toif diff --git a/core/embed/vendorheader/T2T1/vendor_satoshilabs.json b/core/embed/models/T2T1/vendorheader/vendor_satoshilabs.json similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_satoshilabs.json rename to core/embed/models/T2T1/vendorheader/vendor_satoshilabs.json diff --git a/core/embed/vendorheader/T2T1/vendor_satoshilabs.toif b/core/embed/models/T2T1/vendorheader/vendor_satoshilabs.toif similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_satoshilabs.toif rename to core/embed/models/T2T1/vendorheader/vendor_satoshilabs.toif diff --git a/core/embed/vendorheader/T2T1/vendor_unsafe.json b/core/embed/models/T2T1/vendorheader/vendor_unsafe.json similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_unsafe.json rename to core/embed/models/T2T1/vendorheader/vendor_unsafe.json diff --git a/core/embed/vendorheader/T2T1/vendor_unsafe.toif b/core/embed/models/T2T1/vendorheader/vendor_unsafe.toif similarity index 100% rename from core/embed/vendorheader/T2T1/vendor_unsafe.toif rename to core/embed/models/T2T1/vendorheader/vendor_unsafe.toif diff --git a/core/embed/vendorheader/T2T1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin b/core/embed/models/T2T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin b/core/embed/models/T2T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_prodtest_signed_prod.bin b/core/embed/models/T2T1/vendorheader/vendorheader_prodtest_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_prodtest_signed_prod.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_prodtest_signed_prod.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_prodtest_unsigned.bin b/core/embed/models/T2T1/vendorheader/vendorheader_prodtest_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_prodtest_unsigned.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_prodtest_unsigned.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_satoshilabs_signed_prod.bin b/core/embed/models/T2T1/vendorheader/vendorheader_satoshilabs_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_satoshilabs_signed_prod.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_satoshilabs_signed_prod.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_satoshilabs_unsigned.bin b/core/embed/models/T2T1/vendorheader/vendorheader_satoshilabs_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_satoshilabs_unsigned.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_satoshilabs_unsigned.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_unsafe_signed_dev.bin b/core/embed/models/T2T1/vendorheader/vendorheader_unsafe_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_unsafe_signed_dev.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_unsafe_signed_dev.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_unsafe_signed_prod.bin b/core/embed/models/T2T1/vendorheader/vendorheader_unsafe_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_unsafe_signed_prod.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_unsafe_signed_prod.bin diff --git a/core/embed/vendorheader/T2T1/vendorheader_unsafe_unsigned.bin b/core/embed/models/T2T1/vendorheader/vendorheader_unsafe_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T2T1/vendorheader_unsafe_unsigned.bin rename to core/embed/models/T2T1/vendorheader/vendorheader_unsafe_unsigned.bin diff --git a/core/embed/vendorheader/T3B1/vendor_dev_DO_NOT_SIGN.json b/core/embed/models/T3B1/vendorheader/vendor_dev_DO_NOT_SIGN.json similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_dev_DO_NOT_SIGN.json rename to core/embed/models/T3B1/vendorheader/vendor_dev_DO_NOT_SIGN.json diff --git a/core/embed/vendorheader/T3B1/vendor_dev_DO_NOT_SIGN.toif b/core/embed/models/T3B1/vendorheader/vendor_dev_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_dev_DO_NOT_SIGN.toif rename to core/embed/models/T3B1/vendorheader/vendor_dev_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/T3B1/vendor_prodtest.json b/core/embed/models/T3B1/vendorheader/vendor_prodtest.json similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_prodtest.json rename to core/embed/models/T3B1/vendorheader/vendor_prodtest.json diff --git a/core/embed/vendorheader/T3B1/vendor_prodtest.toif b/core/embed/models/T3B1/vendorheader/vendor_prodtest.toif similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_prodtest.toif rename to core/embed/models/T3B1/vendorheader/vendor_prodtest.toif diff --git a/core/embed/vendorheader/T3B1/vendor_trezor.json b/core/embed/models/T3B1/vendorheader/vendor_trezor.json similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_trezor.json rename to core/embed/models/T3B1/vendorheader/vendor_trezor.json diff --git a/core/embed/vendorheader/T3B1/vendor_trezor.toif b/core/embed/models/T3B1/vendorheader/vendor_trezor.toif similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_trezor.toif rename to core/embed/models/T3B1/vendorheader/vendor_trezor.toif diff --git a/core/embed/vendorheader/T3B1/vendor_trezor_btconly.json b/core/embed/models/T3B1/vendorheader/vendor_trezor_btconly.json similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_trezor_btconly.json rename to core/embed/models/T3B1/vendorheader/vendor_trezor_btconly.json diff --git a/core/embed/vendorheader/T3B1/vendor_trezor_btconly.toif b/core/embed/models/T3B1/vendorheader/vendor_trezor_btconly.toif similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_trezor_btconly.toif rename to core/embed/models/T3B1/vendorheader/vendor_trezor_btconly.toif diff --git a/core/embed/vendorheader/T3B1/vendor_unsafe.json b/core/embed/models/T3B1/vendorheader/vendor_unsafe.json similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_unsafe.json rename to core/embed/models/T3B1/vendorheader/vendor_unsafe.json diff --git a/core/embed/vendorheader/T3B1/vendor_unsafe.toif b/core/embed/models/T3B1/vendorheader/vendor_unsafe.toif similarity index 100% rename from core/embed/vendorheader/T3B1/vendor_unsafe.toif rename to core/embed/models/T3B1/vendorheader/vendor_unsafe.toif diff --git a/core/embed/vendorheader/T3B1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin b/core/embed/models/T3B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin diff --git a/core/embed/vendorheader/T3B1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin b/core/embed/models/T3B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin diff --git a/core/embed/vendorheader/T3B1/vendorheader_prodtest_unsigned.bin b/core/embed/models/T3B1/vendorheader/vendorheader_prodtest_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_prodtest_unsigned.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_prodtest_unsigned.bin diff --git a/core/embed/vendorheader/T3B1/vendorheader_trezor_btconly_unsigned.bin b/core/embed/models/T3B1/vendorheader/vendorheader_trezor_btconly_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_trezor_btconly_unsigned.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_trezor_btconly_unsigned.bin diff --git a/core/embed/vendorheader/T3B1/vendorheader_trezor_unsigned.bin b/core/embed/models/T3B1/vendorheader/vendorheader_trezor_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_trezor_unsigned.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_trezor_unsigned.bin diff --git a/core/embed/vendorheader/T3B1/vendorheader_unsafe_signed_dev.bin b/core/embed/models/T3B1/vendorheader/vendorheader_unsafe_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_unsafe_signed_dev.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_unsafe_signed_dev.bin diff --git a/core/embed/vendorheader/T3B1/vendorheader_unsafe_unsigned.bin b/core/embed/models/T3B1/vendorheader/vendorheader_unsafe_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3B1/vendorheader_unsafe_unsigned.bin rename to core/embed/models/T3B1/vendorheader/vendorheader_unsafe_unsigned.bin diff --git a/core/embed/vendorheader/T3T1/vendor_dev_DO_NOT_SIGN.json b/core/embed/models/T3T1/vendorheader/vendor_dev_DO_NOT_SIGN.json similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_dev_DO_NOT_SIGN.json rename to core/embed/models/T3T1/vendorheader/vendor_dev_DO_NOT_SIGN.json diff --git a/core/embed/vendorheader/T3T1/vendor_dev_DO_NOT_SIGN.toif b/core/embed/models/T3T1/vendorheader/vendor_dev_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_dev_DO_NOT_SIGN.toif rename to core/embed/models/T3T1/vendorheader/vendor_dev_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/T3T1/vendor_prodtest.json b/core/embed/models/T3T1/vendorheader/vendor_prodtest.json similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_prodtest.json rename to core/embed/models/T3T1/vendorheader/vendor_prodtest.json diff --git a/core/embed/vendorheader/T3T1/vendor_prodtest.toif b/core/embed/models/T3T1/vendorheader/vendor_prodtest.toif similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_prodtest.toif rename to core/embed/models/T3T1/vendorheader/vendor_prodtest.toif diff --git a/core/embed/vendorheader/T3T1/vendor_trezor.json b/core/embed/models/T3T1/vendorheader/vendor_trezor.json similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_trezor.json rename to core/embed/models/T3T1/vendorheader/vendor_trezor.json diff --git a/core/embed/vendorheader/T3T1/vendor_trezor.toif b/core/embed/models/T3T1/vendorheader/vendor_trezor.toif similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_trezor.toif rename to core/embed/models/T3T1/vendorheader/vendor_trezor.toif diff --git a/core/embed/vendorheader/T3T1/vendor_trezor_btconly.json b/core/embed/models/T3T1/vendorheader/vendor_trezor_btconly.json similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_trezor_btconly.json rename to core/embed/models/T3T1/vendorheader/vendor_trezor_btconly.json diff --git a/core/embed/vendorheader/T3T1/vendor_trezor_btconly.toif b/core/embed/models/T3T1/vendorheader/vendor_trezor_btconly.toif similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_trezor_btconly.toif rename to core/embed/models/T3T1/vendorheader/vendor_trezor_btconly.toif diff --git a/core/embed/vendorheader/T3T1/vendor_unsafe.json b/core/embed/models/T3T1/vendorheader/vendor_unsafe.json similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_unsafe.json rename to core/embed/models/T3T1/vendorheader/vendor_unsafe.json diff --git a/core/embed/vendorheader/T3T1/vendor_unsafe.toif b/core/embed/models/T3T1/vendorheader/vendor_unsafe.toif similarity index 100% rename from core/embed/vendorheader/T3T1/vendor_unsafe.toif rename to core/embed/models/T3T1/vendorheader/vendor_unsafe.toif diff --git a/core/embed/vendorheader/T3T1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin b/core/embed/models/T3T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_signed_dev.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin b/core/embed/models/T3T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_dev_DO_NOT_SIGN_unsigned.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_dev_DO_NOT_SIGN_unsigned.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_prodtest_signed_prod.bin b/core/embed/models/T3T1/vendorheader/vendorheader_prodtest_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_prodtest_signed_prod.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_prodtest_signed_prod.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_prodtest_unsigned.bin b/core/embed/models/T3T1/vendorheader/vendorheader_prodtest_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_prodtest_unsigned.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_prodtest_unsigned.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_trezor_btconly_signed_prod.bin b/core/embed/models/T3T1/vendorheader/vendorheader_trezor_btconly_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_trezor_btconly_signed_prod.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_trezor_btconly_signed_prod.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_trezor_btconly_unsigned.bin b/core/embed/models/T3T1/vendorheader/vendorheader_trezor_btconly_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_trezor_btconly_unsigned.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_trezor_btconly_unsigned.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_trezor_signed_prod.bin b/core/embed/models/T3T1/vendorheader/vendorheader_trezor_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_trezor_signed_prod.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_trezor_signed_prod.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_trezor_unsigned.bin b/core/embed/models/T3T1/vendorheader/vendorheader_trezor_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_trezor_unsigned.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_trezor_unsigned.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_unsafe_signed_dev.bin b/core/embed/models/T3T1/vendorheader/vendorheader_unsafe_signed_dev.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_unsafe_signed_dev.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_unsafe_signed_dev.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_unsafe_signed_prod.bin b/core/embed/models/T3T1/vendorheader/vendorheader_unsafe_signed_prod.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_unsafe_signed_prod.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_unsafe_signed_prod.bin diff --git a/core/embed/vendorheader/T3T1/vendorheader_unsafe_unsigned.bin b/core/embed/models/T3T1/vendorheader/vendorheader_unsafe_unsigned.bin similarity index 100% rename from core/embed/vendorheader/T3T1/vendorheader_unsafe_unsigned.bin rename to core/embed/models/T3T1/vendorheader/vendorheader_unsafe_unsigned.bin diff --git a/core/embed/vendorheader/generate.sh b/core/tools/generate_vendorheader.sh similarity index 69% rename from core/embed/vendorheader/generate.sh rename to core/tools/generate_vendorheader.sh index a2f115d8d..981032a7a 100755 --- a/core/embed/vendorheader/generate.sh +++ b/core/tools/generate_vendorheader.sh @@ -4,8 +4,8 @@ set -e cd $(dirname $0) -BUILDVH=$(realpath ../../tools/build_vendorheader) -BINCTL=$(realpath ../../tools/headertool.py) +BUILDVH=$(realpath ./build_vendorheader) +BINCTL=$(realpath ./headertool.py) for arg in "$@"; do if [ "$arg" == "--check" ]; then @@ -16,10 +16,21 @@ for arg in "$@"; do fi done -MODELS=(T2T1 T2B1 T3T1 T3B1 D001 D002) +cd ../embed/models/ + +# Find directories and store them in an array +dirs=($(find . -maxdepth 1 -type d ! -name '.' | sed 's|^\./||')) + +# Filter directories that have 'vendorheader' subdirectory +MODELS=() +for dir in "${dirs[@]}"; do + if [ -d "$dir/vendorheader" ]; then + MODELS+=("$dir") + fi +done for MODEL in ${MODELS[@]}; do - cd $MODEL + cd ./$MODEL/vendorheader echo "Generating vendor headers for $MODEL" # construct all vendor headers for fn in *.json; do @@ -42,5 +53,5 @@ for MODEL in ${MODELS[@]}; do fi cp -a "$TMPDIR/$DEST_NAME" "$DEST_NAME" done - cd .. + cd ../../ done diff --git a/python/tests/test_firmware.py b/python/tests/test_firmware.py index c3736705a..ff086bb0c 100644 --- a/python/tests/test_firmware.py +++ b/python/tests/test_firmware.py @@ -28,8 +28,9 @@ VENDOR_HEADER = ( HERE.parent.parent / "core" / "embed" - / "vendorheader" + / "models" / "T2T1" + / "vendorheader" / "vendorheader_satoshilabs_signed_prod.bin" )