Skip to content

Commit 342a5aa

Browse files
committed
bash: better support for building under Apple Silicon aarch64/arm64
- turns out `$(uname -m)` can return `arm64` as well as `aarch64` Signed-off-by: Ricardo Pardini <[email protected]>
1 parent 92a2b7a commit 342a5aa

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

bash/kernel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function get_kernel_info_dict() {
121121
# convert ARCH (x86_64, aarch64) to docker-ARCH (amd64, arm64)
122122
case "${kernel_info['ARCH']}" in
123123
"x86_64") kernel_info['DOCKER_ARCH']="amd64" ;;
124-
"aarch64") kernel_info['DOCKER_ARCH']="arm64" ;;
124+
"aarch64" | "arm64") kernel_info['DOCKER_ARCH']="arm64" ;;
125125
*) log error "ARCH ${kernel_info['ARCH']} not supported" && exit 1 ;;
126126
esac
127127
}
@@ -139,7 +139,7 @@ function get_host_docker_arch() {
139139
# convert ARCH (x86_64, aarch64) to docker-ARCH (amd64, arm64)
140140
case "$(uname -m)" in
141141
"x86_64") host_docker_arch="amd64" ;;
142-
"aarch64") host_docker_arch="arm64" ;;
142+
"aarch64" | "arm64") host_docker_arch="arm64" ;;
143143
*) log error "ARCH $(uname -m) not supported" && exit 1 ;;
144144
esac
145145
return 0

bash/kernel/kernel_armbian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function calculate_kernel_version_armbian() {
5050
declare oras_arch="unknown"
5151
case "$(uname -m)" in
5252
"x86_64") oras_arch="amd64" ;;
53-
"aarch64") oras_arch="arm64" ;;
53+
"aarch64" | "arm64") oras_arch="arm64" ;;
5454
*) log error "ERROR: ARCH $(uname -m) not supported by ORAS? check https://github.com/oras-project/oras/releases" && exit 1 ;;
5555
esac
5656
declare oras_down_url="https://github.com/oras-project/oras/releases/download/v${oras_version}/oras_${oras_version}_linux_${oras_arch}.tar.gz"

bash/kernel/kernel_default.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function calculate_kernel_version_default() {
3636
KERNEL_CROSS_COMPILE="x86_64-linux-gnu-"
3737
KERNEL_OUTPUT_IMAGE="arch/x86_64/boot/bzImage"
3838
;;
39-
"aarch64")
39+
"aarch64" | "arm64")
4040
KERNEL_ARCH="arm64"
4141
KERNEL_CROSS_COMPILE_PKGS="crossbuild-essential-arm64"
4242
KERNEL_CROSS_COMPILE="aarch64-linux-gnu-"

bash/linuxkit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function obtain_linuxkit_binary_cached() {
1010
# determine the arch to download from current arch
1111
case "$(uname -m)" in
1212
"x86_64") linuxkit_arch="amd64" ;;
13-
"aarch64") linuxkit_arch="arm64" ;;
13+
"aarch64" | "arm64") linuxkit_arch="arm64" ;;
1414
*) log error "ERROR: ARCH $(uname -m) not supported by linuxkit? check https://github.com/linuxkit/linuxkit/releases" && exit 1 ;;
1515
esac
1616

0 commit comments

Comments
 (0)