From 7c0a89950045fdd127f0c8b3b12129ac6a979fc0 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 21 Aug 2025 07:50:00 -0500 Subject: [PATCH] board/qemu: Generate sdcard.img with post-image In order to test AimeeOS A/B filesystem updates, we need a full disk image just like the Raspberry Pi variant has. --- board/qemu/post-image.sh | 22 ++++++++++++++++++++++ ci/Jenkinsfile | 4 ++++ configs/aimeeos_qemu_aarch64_defconfig | 1 + 3 files changed, 27 insertions(+) create mode 100644 board/qemu/post-image.sh diff --git a/board/qemu/post-image.sh b/board/qemu/post-image.sh new file mode 100644 index 0000000..e546986 --- /dev/null +++ b/board/qemu/post-image.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +BOARD_DIR=$(dirname "$0") +GRUBENV="${BINARIES_DIR}"/efi-part/EFI/BOOT/grubenv + +genimage_tmp=$(mktemp -d) +trap 'rm -rf "${genimage_tmp}"' EXIT + +mkdir -p "${genimage_tmp}"/rootfs "${genimage_tmp}"/tmp + +grub-editenv "${GRUBENV}" set default=0 +grub-editenv "${GRUBENV}" set timeout=3 + +cd "${BINARIES_DIR}" +genimage \ + --rootpath "${genimage_tmp}/rootfs" \ + --tmppath "${genimage_tmp}/tmp" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${BOARD_DIR}"/genimage.cfg diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index accda4b..d6e5ad6 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -53,8 +53,12 @@ pipeline { archiveArtifacts('.config') } dir('_build/images') { + sh 'zstd -f firmware.img' + sh 'zstd -f sdcard.img' archiveArtifacts([ + 'firmware.img.zst', 'rootfs.squashfs', + 'sdcard.img.zst', ].join(',')) } } diff --git a/configs/aimeeos_qemu_aarch64_defconfig b/configs/aimeeos_qemu_aarch64_defconfig index 4e54602..2527788 100644 --- a/configs/aimeeos_qemu_aarch64_defconfig +++ b/configs/aimeeos_qemu_aarch64_defconfig @@ -3,6 +3,7 @@ BR2_TOOLCHAIN_BUILDROOT_VENDOR="aimeeos" BR2_GLOBAL_PATCH_DIR="board/qemu/patches" BR2_DOWNLOAD_FORCE_CHECK_HASHES=y BR2_INIT_SYSTEMD=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/qemu/post-image.sh" # BR2_INIT_SYSTEMD_POPULATE_TMPFILES is not set # BR2_TARGET_ENABLE_ROOT_LOGIN is not set # BR2_TARGET_GENERIC_GETTY is not set