From 6928c5a6c2784fed8e603aed6c4e51a3328b2332 Mon Sep 17 00:00:00 2001 From: AbelLykens <47113175+AbelLykens@users.noreply.github.com> Date: Fri, 27 Jan 2023 21:36:48 +0100 Subject: [PATCH 1/2] Ubuntu 20.04 (clean) requirements After https://github.com/Coldcard/firmware/pull/173 I started a new clean Ubuntu 20.04. This PR adds on what I missed, and explains steps a bit more + includes command for running outside of virt environment. --- README.md | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a0d02e78c..f35ecfd5a 100644 --- a/README.md +++ b/README.md @@ -135,27 +135,33 @@ See ### Linux -You'll need to install these (Ubuntu 20.04): +All steps you need to install and run the Coldcard simulator on Ubuntu 20.04: + ```shell -apt install build-essential git python3 python3-pip libudev-dev gcc-arm-none-eabi libffi-dev xterm swig libpcsclite-dev python-is-python3 autoconf libtool -``` +# Install (system) requirements, tools and libraries +apt install build-essential git python3 python3-pip libudev-dev gcc-arm-none-eabi libffi-dev xterm swig libpcsclite-dev python-is-python3 autoconf libtool python3-venv -Install and run simulator on Ubuntu 20.04 +# Install all in home directory (optional but useful later) +cd ~ -```shell +# Get sources, this takes a long time (because of external libraries), then open git clone --recursive https://github.com/Coldcard/firmware.git cd firmware -# apply address patch -git apply unix/linux_addr.patch -# create virtualenv and activate it + +# Apply address patch +git apply unix/linux_addr.patch + +# Create Python virtual environment and activate it python3 -m venv ENV # or virtualenv -p python3 ENV source ENV/bin/activate -# install dependencies + +# Install dependencies pip install -U pip setuptools pip install -r requirements.txt #general requirements pip install pysdl2-dll # Ubuntu needs this dependency -# build simulator + +# Build the Coldcard simulator cd unix pushd ../external/micropython/mpy-cross/ make # mpy-cross @@ -163,8 +169,13 @@ popd make setup make ngu-setup make -# below line runs the simulator + +# Run the simulator in the active virtualenv ./simulator.py + +# Later, if you want to run it (after a reboot): +cd ~/firmware/unix/ +~/firmware/ENV/bin/python3 ./simulator.py ``` Also make sure that you have your python3 symlinked to python. From 21ae3aab22064d7763ab368e57706446f7c71be5 Mon Sep 17 00:00:00 2001 From: AbelLykens <47113175+AbelLykens@users.noreply.github.com> Date: Fri, 27 Jan 2023 21:45:42 +0100 Subject: [PATCH 2/2] Don't assume people install in home dir Don't assume people install in home dir and don't instruct people to, either. --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f35ecfd5a..d8721fa52 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,6 @@ All steps you need to install and run the Coldcard simulator on Ubuntu 20.04: # Install (system) requirements, tools and libraries apt install build-essential git python3 python3-pip libudev-dev gcc-arm-none-eabi libffi-dev xterm swig libpcsclite-dev python-is-python3 autoconf libtool python3-venv -# Install all in home directory (optional but useful later) -cd ~ - # Get sources, this takes a long time (because of external libraries), then open git clone --recursive https://github.com/Coldcard/firmware.git cd firmware @@ -173,9 +170,11 @@ make # Run the simulator in the active virtualenv ./simulator.py -# Later, if you want to run it (after a reboot): -cd ~/firmware/unix/ -~/firmware/ENV/bin/python3 ./simulator.py +# Later, if you want to run it (after a reboot). This assumes you extracted the git repo in ~ (home) +cd ~/firmware +source ENV/bin/activate +cd unix +./simulator.py ``` Also make sure that you have your python3 symlinked to python.