From d33aafa6776c0ebb6ac8ffe06702c731a7636bdd Mon Sep 17 00:00:00 2001 From: Pat Nakajima Date: Sun, 24 May 2026 20:21:19 +0000 Subject: [PATCH] handle being on an arm64 system --- scripts/bootstrap-repo.sh | 36 ++++++++++++++++++++++-------------- scripts/build-in-chroot.sh | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/scripts/bootstrap-repo.sh b/scripts/bootstrap-repo.sh index 4103d17..26181e3 100755 --- a/scripts/bootstrap-repo.sh +++ b/scripts/bootstrap-repo.sh @@ -4,18 +4,26 @@ set -ex # bootstrap _this_ repo (toes-image-builder), not the image itself. # should only have to do this once per host we run this on. -sudo apt-get update -sudo apt-get install -y \ - qemu-user-static \ - binfmt-support \ - qemu-system-arm \ - qemu-utils \ - kpartx \ - parted \ - fdisk \ - dosfstools \ - e2fsprogs \ - xz-utils \ - rsync \ - curl \ +packages=( + kpartx + parted + fdisk + dosfstools + e2fsprogs + xz-utils + rsync + curl ca-certificates +) + +case "$(uname -m)" in + aarch64|arm64) + echo "native arm64 host detected; skipping qemu user emulation packages" + ;; + *) + packages=(qemu-user-static binfmt-support "${packages[@]}") + ;; +esac + +sudo apt-get update +sudo apt-get install -y "${packages[@]}" diff --git a/scripts/build-in-chroot.sh b/scripts/build-in-chroot.sh index 46b0db8..7ff8fbc 100755 --- a/scripts/build-in-chroot.sh +++ b/scripts/build-in-chroot.sh @@ -1,7 +1,7 @@ #! /bin/bash set -ex -# runs setup commands inside the image, under qemu arm64. +# runs setup commands inside the arm64 image rootfs. sudo tee mnt/root/tmp/image-build.sh >/dev/null <<'EOF' #! /bin/bash