balena-supervisor/build-utils/detect-arch.sh
pipex a1e432f4fa Add build util to automatically detect arch from uname
This will help running `test:env` and `test:compose` in environments
other than `amd64`.
2022-10-17 11:32:47 -03:00

34 lines
302 B
Bash
Executable File

#!/bin/sh
# detect-arch.sh
case $(uname -m) in
x86_64)
echo "amd64"
;;
aarch64)
:
echo "aarch64"
;;
arm64)
echo "aarch64"
;;
armv7l)
echo "armv7hf"
;;
armv6l)
echo "rpi"
;;
i686)
:
echo "i386"
;;
i386)
:
echo "i386"
;;
*)
echo >&2 "Unknown architecture $(uname -m)"
exit 1
;;
esac