|
| 1 | +# Trezor Firmware |
| 2 | + |
| 3 | +:::info No GUI (yet) |
| 4 | + |
| 5 | +This firmware and build process is fully CLI-based. |
| 6 | +There is currently **no graphical interface** for managing the Mintlayer Trezor firmware. |
| 7 | + |
| 8 | +A GUI is in development, but **not yet available**. |
| 9 | + |
| 10 | +::: |
| 11 | + |
| 12 | +:::warning ️ Risk of Device Damage |
| 13 | + |
| 14 | +The steps below are intended for advanced users. Flashing unofficial firmware **may permanently damage your Trezor device** or void its warranty. |
| 15 | + |
| 16 | +Only proceed if you fully understand each step and accept the risks. Do **not** run these commands on a production or primary hardware wallet unless you are absolutely sure of what you are doing. |
| 17 | + |
| 18 | +::: |
| 19 | + |
| 20 | +## Building Mintlayer Trezor Firmware |
| 21 | + |
| 22 | +Ubuntu 24.04 is the recommended environment for building the Mintlayer Trezor firmware. The following steps will guide you through the process of setting up your environment and building the firmware. |
| 23 | + |
| 24 | +```bash |
| 25 | +sudo apt update # Update package lists to get the latest available versions |
| 26 | + |
| 27 | +sudo apt install git # Install Git for cloning repositories |
| 28 | + |
| 29 | +git clone --recurse-submodules https://github.com/mintlayer/mintlayer-trezor-firmware.git # Clone the firmware repo including its submodules |
| 30 | + |
| 31 | +cd mintlayer-trezor-firmware # Change directory to the cloned firmware project |
| 32 | + |
| 33 | +git checkout mintlayer-master # Switch to the Mintlayer-specific firmware branch |
| 34 | + |
| 35 | +curl -sSL https://install.python-poetry.org | python3 - # Install Poetry, a dependency manager for Python |
| 36 | + |
| 37 | +poetry intall # (typo) Install Python dependencies listed in pyproject.toml (should be `poetry install`) |
| 38 | + |
| 39 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Install Rust toolchain via rustup |
| 40 | + |
| 41 | +rustup default nightly # Set the nightly version of Rust as the default toolchain |
| 42 | + |
| 43 | +rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu # Add Rust source code (needed for cross-compilation) |
| 44 | + |
| 45 | +sudo apt install -y build-essential # Install essential tools for building software (e.g., gcc, make) |
| 46 | + |
| 47 | +sudo apt install -y python3.12-dev libffi-dev # Install Python 3.12 development headers and foreign function interface libraries |
| 48 | + |
| 49 | +sudo apt install -y gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi # Install cross-compilation toolchain for ARM (used by Trezor) |
| 50 | + |
| 51 | +sudo apt install -y protobuf-compiler # Install the Protocol Buffers compiler (used in serialization) |
| 52 | + |
| 53 | +sudo apt install -y clang llvm-dev libclang-dev # Install LLVM/Clang compiler and development libraries |
| 54 | + |
| 55 | +cd core # Move into the `core` directory of the firmware source |
| 56 | + |
| 57 | +source $(poetry env info --path)/bin/activate # Activate the virtual environment created by Poetry |
| 58 | + |
| 59 | +TREZOR_MODEL=T3T1 make vendor build_firmware # Set the target Trezor model and build the firmware with required vendor files |
| 60 | +``` |
| 61 | + |
| 62 | +## Pre-requisites |
| 63 | + |
| 64 | +Device bootloader must be unlocked to allow unofficial firmware installation. This can be done by following the instructions in the [Trezor documentation](https://trezor.io/learn/security-privacy/unlocking-the-bootloader-on-trezor-safe-devices). |
0 commit comments