Skip to content
Myr

[Fix] `nvm_get_arch`: Rasbperry Pi: armv7l with arm64 kernel, get correct arch

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Botspot · committed by Jordan Harband · parent 2b5e53f · Browse files · 2 files+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Botspot <54716352+Botspot@users.noreply.github.com>
  • Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>

Diff stats

2 files+10 added−0 removed

  • tests:+2 added−0 removed
  • other:+8 added−0 removed

2 files+10 added−0 removed

modified:test/fast/Unit tests/nvm_get_arch+2 added
77 unmodified lines
7879run_test x86 osx x8680run_test amd64 osx x648182run_test arm64 smartos x648384cleanup
modified:nvm.sh+8 added
1794 unmodified lines
1795 i*86) NVM_ARCH="x86" ;;1796 aarch64) NVM_ARCH="arm64" ;;1797 *) NVM_ARCH="${HOST_ARCH}" ;;1798 esac17991800 # If running a 64bit ARM kernel but a 32bit ARM userland, change ARCH to 32bit ARM (armv7l)1801 L=$(ls -dl /sbin/init) # if /sbin/init is 32bit executable1802 if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] && [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then1803 NVM_ARCH=armv7l1804 HOST_ARCH=armv7l1805 fi18061807 nvm_echo "${NVM_ARCH}"1808}18091810nvm_get_minor_version() {
2385 unmodified lines