Last active
June 7, 2021 22:36
-
-
Save tecnovert/8529c007c2e68cb7ae30736dd8f05827 to your computer and use it in GitHub Desktop.
Compile Ledger firmware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://ledger.readthedocs.io/en/latest/userspace/setup.html | |
cat << EOF > Dockerfile | |
from ubuntu:bionic | |
RUN apt-get update && \ | |
apt-get upgrade -y && \ | |
apt-get install -y wget bzip2 xz-utils git make libc6-dev-i386 usbutils python3-setuptools zlib1g-dev python3-pip libusb-1.0-0-dev libudev-dev gcc-multilib g++-multilib libjpeg8-dev zlib1g-dev | |
RUN mkdir /home/bolos_env && cd /home/bolos_env && \ | |
wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \ | |
tar xvf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | |
RUN cd /home/bolos_env && \ | |
wget https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz && \ | |
tar xvf clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz && \ | |
ln -s clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 clang-arm-fropi | |
RUN cd /home && \ | |
git clone https://github.com/LedgerHQ/nanos-secure-sdk.git && \ | |
cd /home/nanos-secure-sdk && \ | |
git checkout 2.0.0-1 | |
ENV LIBPATH="${LIBPATH}:/usr/lib/x86_64-linux-gnu/" \ | |
BOLOS_SDK=/home/nanos-secure-sdk \ | |
COIN=particl | |
# Or COIN=particl_testnet | |
RUN ln -s /usr/bin/python3 /usr/bin/python && \ | |
cd /home && \ | |
git clone https://github.com/ledgerhq/blue-loader-python && \ | |
cd /home/blue-loader-python && \ | |
pip3 install pillow==3.4.0 && \ | |
pip3 install Cython && \ | |
pip3 install websocket_client python-u2flib-host ecpy future pycryptodomex protobuf && \ | |
python3 setup.py install | |
RUN cd /home && \ | |
git clone https://github.com/LedgerHQ/app-particl.git ledger-app-particl && \ | |
cd /home/ledger-app-particl && \ | |
git checkout nanos___2021-02-01_13-28-11 | |
EOF | |
docker build -t particl_ledger_1.2.13 . | |
docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb particl_ledger_1.2.13 /bin/bash | |
export BOLOS_SDK=/home/nanos-secure-sdk COIN=particl | |
export CLANGPATH=/home/bolos_env/clang-arm-fropi/bin/ | |
export GCCPATH=/home/bolos_env/gcc-arm-none-eabi-10-2020-q4-major/bin/ | |
cd /home/ledger-app-particl | |
make clean | |
make -B | |
Should end with: | |
[LINK] bin/app.elf | |
Connect Ledger Nano S and input pin no. | |
lsusb | |
... ID 2c97:1011 | |
Remove old app if installed | |
make delete | |
make load | |
Application full hash : 7787b7bcc85ee2c185fe6a621049928f4bdbe7cdfeb03672a421ee9bc6fe0236 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment