Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add stax support to docker-make #72

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <TARGET_SDK>
Expand Down
4 changes: 2 additions & 2 deletions docker-make
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
docker_tag=73c9e07
docker_tag=latest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer a named tag. latest lets the docker image wreck your dev environment behind your back. the docker image should only be updated intentionally and along with any required compatibility changes

docker_image_base=ledger-app-builder
docker_image="${docker_image_base}:${docker_tag}"

Expand All @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion util/active-target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}"
Expand All @@ -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
Expand All @@ -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"
;;
"")
Expand Down