balena-supervisor/build-utils/apk-print-arch.sh
Felipe Lalanne 1cf325d5c5 Add fail-safe to test the image architecture
Verify that the target image architecture matches what is expected
according to the balena app architecture.

Change-type: patch
2023-06-19 15:36:39 -04:00

25 lines
249 B
Bash
Executable File

#!/bin/sh
# detect-arch.sh
apk_arch=$(apk --print-arch)
case $apk_arch in
x86_64)
printf "amd64"
;;
aarch64)
printf "aarch64"
;;
armv7)
printf "armv7hf"
;;
armhf)
printf "rpi"
;;
x86)
printf "i386"
;;
*)
printf "%s" "$apk_arch"
;;
esac