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

Add support for armv6l architecture in install script for Raspberry Pi Zero #10

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

kou029w
Copy link
Contributor

@kou029w kou029w commented Jul 15, 2024

Environment

  • Device: Raspberry Pi Zero
  • Operating System: Linux 6.6.31+rpi-rpi-v6
  • Architecture: armv6l

Issue

The install script https://webinstall.dev/api/installers/node@lts.sh fails to execute on Raspberry Pi Zero due to an invalid architecture value derived from the User-Agent string.

Example User-Agent string: Linux/6.6.31+rpi-rpi-v6 armv6l/unknown gnu

### https://github.com/webinstall/webi-installers/blob/5c12cb1fa7f01c851de912344a9d29e288ce6215/webi/webi.sh#L77C1-L86C1
$ echo $WEBI_UA
Linux/6.6.31+rpi-rpi-v6 armv6l/unknown gnu

Changes

Updated the architecture detection map to include armv6l.

@coolaj86
Copy link
Member

@kou029w Sorry I didn't see this until today. It's up on https://beta.webinstall.dev.

Will you test it out?

@kou029w
Copy link
Contributor Author

kou029w commented Sep 11, 2024

Thanks for the update!
I tested it on a Raspberry Pi Zero and everything worked as expected!

pi@raspberrypi:~ $ curl -sS https://beta.webi.sh/node | sh


>>> Welcome to Webi! - modern tools, instant installs.  <<<
    We expect your experience to be absolutely perfect!

    Success? Star it!   https://github.com/webinstall/webi-installers
    Problem? Report it: https://github.com/webinstall/webi-installers/issues
                        (your system is GNU/Linux/armv6l with libc & curl+wget)

Bootstrapping Webi
    Downloading https://beta.webi.sh/packages/webi/webi.sh
        to ~/.local/bin/webi
    Running ~/.local/bin/webi node@stable

Installing node ...
    Found  ~/.local/bin
    Initializing ~/.config/envman/
    Edit ~/.profile to source ~/.config/envman/load.sh
    Edit ~/.bashrc to source ~/.config/envman/load.sh
    WARN: possible PATH conflict between 'node v20.17.0' and currently installed version
    /home/pi/.local/opt/node/bin/node (new)
    /usr/local/bin/node (existing)
    Downloading node from
      https://unofficial-builds.nodejs.org/download/release/v20.17.0/node-v20.17.0-linux-armv6l.tar.xz
    Saved as ~/Downloads/webi/node/20.17.0/node-v20.17.0-linux-armv6l.tar.xz
    Extracting ~/Downloads/webi/node/20.17.0/node-v20.17.0-linux-armv6l.tar.xz
    Installing to ~/.local/opt/node-v20.17.0/bin/node

    Installed node and npm at ~/.local/opt/node/

    Edit ~/.config/envman/PATH.env to add:
        ~/.local/bin
        ~/.local/opt/node/bin

>>> ACTION REQUIRED <<<
        Copy, paste & run the following command:
        source ~/.config/envman/PATH.env
        (newly opened terminal windows will update automatically)

pi@raspberrypi:~ $ ~/.local/opt/node/bin/node -v
v20.17.0

…i Zero

## Environment

- Device: Raspberry Pi Zero
- Operating System: Linux 6.6.31+rpi-rpi-v6
- Architecture: armv6l

## Issue

The install script https://webinstall.dev/api/installers/node@lts.sh fails to execute on Raspberry Pi Zero due to an invalid architecture value derived from the User-Agent string.

Example User-Agent string: `Linux/6.6.31+rpi-rpi-v6 armv6l/unknown gnu`

```
### https://github.com/webinstall/webi-installers/blob/5c12cb1fa7f01c851de912344a9d29e288ce6215/webi/webi.sh#L77C1-L86C1
$ echo $WEBI_UA
Linux/6.6.31+rpi-rpi-v6 armv6l/unknown gnu
```

## Changes

Updated the architecture detection map to include armv6l.
@coolaj86
Copy link
Member

Very nice use of <details><summary>. A+.

I'm batching some other changes and this will go live with those in prod today.

@coolaj86
Copy link
Member

Also: I'd be curious to know if the armv7l builds run on the Pi Zero.

I believe that many of the armv6l CPUs will actually run armv7l binaries (but not armv7a).

https://nodejs.org/download/release/v20.17.0/node-v20.17.0-linux-armv7l.tar.xz

@kou029w
Copy link
Contributor Author

kou029w commented Sep 12, 2024

The armv7l binary does not seem to be compatible with the Raspberry Pi Zero, as it results in an Illegal instruction error. (It might work with the Raspberry Pi Zero 2, though.)

pi@raspberrypi:~ $ ./node-v20.17.0-linux-armv7l/bin/node -v
Illegal instruction

@coolaj86 coolaj86 merged commit 28536b0 into webinstall:main Sep 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants