From f63f4e7bc5ac3a8d72465e32956406f9178d0bc1 Mon Sep 17 00:00:00 2001 From: Gildas Le Nadan <3ntr0p13+github@gmail.com> Date: Thu, 19 Dec 2024 18:00:13 +1000 Subject: [PATCH 1/3] move to aarch64/arm64 --- .github/workflows/build.yml | 6 +++--- bin/build-packer.sh | 1 - bin/build-qemu.sh | 2 +- packer.json | 8 +++++--- tasks/docker.yaml | 2 +- tasks/ini2env.yaml | 2 +- test.json | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab78c50..939211c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,15 +69,15 @@ jobs: - name: build qemu run: | bash bin/build-qemu.sh - sudo ln -s $HOME/qemu/bin/qemu-arm /usr/local/bin/qemu-arm-static + sudo ln -s $HOME/qemu/bin/qemu-aarch64 /usr/local/bin/qemu-aarch64-static - name: build packer-builder-arm-image run: | bash bin/build-packer.sh - - name: Download raspberrypios 32 bits iso + - name: Download raspberrypios 64 bits iso run: | - wget -nv https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-11-19/2024-11-19-raspios-bookworm-armhf-lite.img.xz + wget -nv https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz - name: build pimba image run: | diff --git a/bin/build-packer.sh b/bin/build-packer.sh index 0f184c5..6c48659 100755 --- a/bin/build-packer.sh +++ b/bin/build-packer.sh @@ -21,7 +21,6 @@ unzip "packer_${VERSION}_linux_amd64.zip" -d packer/bin cd ${HOME}/packer/build git clone https://github.com/solo-io/packer-plugin-arm-image.git/ cd packer-plugin-arm-image -git checkout v0.2.0 go mod download go build mv packer-plugin-arm-image ${HOME}/packer/bin/packer-plugin-arm-image diff --git a/bin/build-qemu.sh b/bin/build-qemu.sh index 1b3dab1..1e84a1e 100755 --- a/bin/build-qemu.sh +++ b/bin/build-qemu.sh @@ -2,7 +2,7 @@ set -e VERSION=${QEMU_VERSION:=9.1.2} -ARCHES=${QEMU_ARCHES:=arm} +ARCHES=${QEMU_ARCHES:=aarch64} TARGETS=${QEMU_TARGETS:=$(echo $ARCHES | sed 's#$# #;s#\([^ ]*\) #\1-softmmu \1-linux-user #g')} if echo "$VERSION $TARGETS" | cmp --silent $HOME/qemu/.build -; then diff --git a/packer.json b/packer.json index d070ab7..22ba6ca 100644 --- a/packer.json +++ b/packer.json @@ -4,11 +4,13 @@ }, "builders": [{ "type": "arm-image", - "iso_url" : "2024-11-19-raspios-bookworm-armhf-lite.img.xz", - "iso_checksum" : "1dacc70cc09162c995020ac1739ee60e6843cf2bfb393654e694e3f017d781bb", + "iso_url" : "2024-11-19-raspios-bookworm-arm64-lite.img.xz", + "iso_checksum" : "6ac3a10a1f144c7e9d1f8e568d75ca809288280a593eb6ca053e49b539f465a4", "target_image_size" : 5368709120, "output_filename" : "/tmp/image", - "mount_path": "{{ user `img_mount_path` }}" + "mount_path": "{{ user `img_mount_path` }}", + "disable_embedded": true, + "qemu_binary": "/usr/local/bin/qemu-aarch64-static" }], "provisioners": [{ "type": "shell-local", diff --git a/tasks/docker.yaml b/tasks/docker.yaml index b2efbaa..2a82d07 100755 --- a/tasks/docker.yaml +++ b/tasks/docker.yaml @@ -4,7 +4,7 @@ - name: add docker package list apt_repository: filename: docker - repo: deb [arch=armhf] https://download.docker.com/linux/debian {{ debian_distro }} stable + repo: deb [arch=arm64] https://download.docker.com/linux/debian {{ debian_distro }} stable - name: install packages apt: diff --git a/tasks/ini2env.yaml b/tasks/ini2env.yaml index b7fe0c8..c3dcdd8 100644 --- a/tasks/ini2env.yaml +++ b/tasks/ini2env.yaml @@ -1,6 +1,6 @@ - name: Download ini2env and unpack it unarchive: - src: https://github.com/endemics/ini2env/releases/download/v0.1.1/ini2env_0.1.1_linux_armhf.tgz + src: https://github.com/endemics/ini2env/releases/download/v0.1.1/ini2env_0.1.1_linux_arm64.tgz remote_src: yes dest: /usr/local/bin owner: root diff --git a/test.json b/test.json index 0def2f3..f82a3c5 100644 --- a/test.json +++ b/test.json @@ -26,7 +26,7 @@ "LC_ALL=C" ], "inline": [ - "curl -L https://github.com/goss-org/goss/releases/download/v{{ user `goss_version` }}/goss-linux-arm -o /tmp/goss-linux-arm && chmod a+x /tmp/goss-linux-arm", + "curl -Ls https://github.com/goss-org/goss/releases/download/v{{ user `goss_version` }}/goss-linux-arm -o /tmp/goss-linux-arm && chmod a+x /tmp/goss-linux-arm", "cd /tmp/goss && /tmp/goss-linux-arm validate --format documentation --color" ] } From 279d1273175e2620576f08e521067877dda44013 Mon Sep 17 00:00:00 2001 From: Gildas Le Nadan <3ntr0p13+github@gmail.com> Date: Thu, 19 Dec 2024 20:36:29 +1000 Subject: [PATCH 2/3] Make sure we use the aarch64 qemu binary --- test.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.json b/test.json index f82a3c5..91de4ca 100644 --- a/test.json +++ b/test.json @@ -11,7 +11,9 @@ "image_type": "raspberrypi", "target_image_size" : 5368709120, "output_filename" : "/tmp/testimage", - "mount_path": "{{ user `img_mount_path` }}" + "mount_path": "{{ user `img_mount_path` }}", + "disable_embedded": true, + "qemu_binary": "/usr/local/bin/qemu-aarch64-static" }], "provisioners": [ { From c1b0ff958309d2e0d6b1d63b5c03f5bd1e56c723 Mon Sep 17 00:00:00 2001 From: Gildas Le Nadan <3ntr0p13+github@gmail.com> Date: Thu, 19 Dec 2024 21:11:57 +1000 Subject: [PATCH 3/3] use goss arm64 --- test.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.json b/test.json index 91de4ca..a4f3a13 100644 --- a/test.json +++ b/test.json @@ -28,8 +28,8 @@ "LC_ALL=C" ], "inline": [ - "curl -Ls https://github.com/goss-org/goss/releases/download/v{{ user `goss_version` }}/goss-linux-arm -o /tmp/goss-linux-arm && chmod a+x /tmp/goss-linux-arm", - "cd /tmp/goss && /tmp/goss-linux-arm validate --format documentation --color" + "curl -Ls https://github.com/goss-org/goss/releases/download/v{{ user `goss_version` }}/goss-linux-arm64 -o /tmp/goss-linux-arm64 && chmod a+x /tmp/goss-linux-arm64", + "cd /tmp/goss && /tmp/goss-linux-arm64 validate --format documentation --color" ] } ],