From 4c4fefb0c6590ec1f273fa80e82d090539033523 Mon Sep 17 00:00:00 2001 From: Johannes Leupolz Date: Tue, 3 Feb 2026 20:52:22 +0000 Subject: [PATCH] distro tests: download ubuntu image --- distro-tests/ubuntu-24.04/download.sh | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 distro-tests/ubuntu-24.04/download.sh diff --git a/distro-tests/ubuntu-24.04/download.sh b/distro-tests/ubuntu-24.04/download.sh new file mode 100644 index 0000000..2295e26 --- /dev/null +++ b/distro-tests/ubuntu-24.04/download.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# SPDX-License-Identifier: MIT +set -eu + +ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +PREPARED_IMG_DIR="${ROOT_DIR}/prepared" + +IMG_NAME="ubuntu-24.04-noble-base.qcow2" +IMG_PATH="${PREPARED_IMG_DIR}/${IMG_NAME}" + +SRC_URL="https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img" + +mkdir -p "${PREPARED_IMG_DIR}" + +if [ -f "${IMG_PATH}" ]; then + echo "[*] Ubuntu 24.04 base image already present" + exit 0 +fi + +echo "[*] Downloading Ubuntu 24.04 cloud image" +curl -L "${SRC_URL}" -o "${IMG_PATH}.tmp" + +echo "[*] Converting to qcow2" +qemu-img convert -c -O qcow2 "${IMG_PATH}.tmp" "${IMG_PATH}" + +rm -f "${IMG_PATH}.tmp" + +echo "[✓] Ubuntu 24.04 base image ready"