From 26f246f77b297b9c061771a45cad58e99374dad9 Mon Sep 17 00:00:00 2001 From: kewde Date: Tue, 4 Jul 2023 12:42:35 +0200 Subject: [PATCH] feat: add stax support to `docker-make` --- README.md | 23 ++++++++--------------- docker-make | 4 ++-- util/active-target.sh | 6 +++++- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 5d144947..5dd76fe7 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,14 @@ Current Features: ### For building the app * [Install Docker](https://docs.docker.com/get-docker/) * For Linux hosts, install the Ledger Nano [udev rules](https://github.com/LedgerHQ/udev-rules) -#### Build the [Ledger App Builder](https://developers.ledger.com/docs/nano-app/build/) Docker image -1. Clone the git repository -``` -git clone https://github.com/LedgerHQ/ledger-app-builder.git -``` -2. Change directories -``` -cd ledger-app-builder -``` -3. Checkout the target commit -``` -git checkout 73c9e07 -``` -4. Build the image +#### Get the [Ledger App Builder](https://developers.ledger.com/docs/nano-app/build/) Docker image +1. Pull the docker image +```bash +docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder ``` -docker build -t ledger-app-builder:73c9e07 . +2. Tag the docker image +```bash +docker image tag ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder ledger-app-builder ``` * If permissions errors are encountered, ensure that your user is in the `docker` group and that the session has been restarted @@ -93,6 +85,7 @@ from clean and clean must be run _before_ switching |s|Nano S| |x|Nano X| |sp|Nano S+| +|stax|Stax| ```bash ./docker-make diff --git a/docker-make b/docker-make index 26605154..0c94cf0a 100755 --- a/docker-make +++ b/docker-make @@ -1,5 +1,5 @@ #!/usr/bin/env bash -docker_tag=73c9e07 +docker_tag=latest docker_image_base=ledger-app-builder docker_image="${docker_image_base}:${docker_tag}" @@ -19,7 +19,7 @@ fi target_sdk="${maybe_target_sdk:-"$last_target_sdk"}" if [[ -z "$target_sdk" ]]; then - echo 'cannot resolve target sdk. please pass `s`, `x` or `sp` as the first argument' 1>&2 + echo 'cannot resolve target sdk. please pass `s`, `x`, `sp` or `stax` as the first argument' 1>&2 exit 1 elif [[ -z "$last_target_sdk" ]]; then write_last_target_sdk_mnemonic "$here" "$target_sdk" diff --git a/util/active-target.sh b/util/active-target.sh index 3e95b566..8daaf461 100644 --- a/util/active-target.sh +++ b/util/active-target.sh @@ -3,6 +3,7 @@ declare -r nanos_sdk=NANOS_SDK declare -r nanox_sdk=NANOX_SDK declare -r nanosp_sdk=NANOSP_SDK +declare -r stax_sdk=STAX_SDK sdk_mnemonic_to_bolos_variable() { local -r sdk_mnemonic="${1:?}" @@ -17,6 +18,9 @@ sdk_mnemonic_to_bolos_variable() { sp) bolos_sdk_var="$nanosp_sdk" ;; + stax) + bolos_sdk_var="$stax_sdk" + ;; *) echo "unimplemented sdk mnemonic: \`$sdk\`" 1>&2 exit 1 @@ -39,7 +43,7 @@ normalize_mnemonic() { local -r l_target_sdk_mnemonic="$(tr '[:upper:]' '[:lower:]' <<<"$target_sdk_mnemonic")" local normalized_target_sdk_mnemonic= case "$l_target_sdk_mnemonic" in - s|x|sp) + s|x|sp|stax) normalized_target_sdk_mnemonic="$l_target_sdk_mnemonic" ;; "")