From 6b1dc8767834e15e2f2452e13b375d1e133107b8 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 10 Sep 2026 17:44:20 -0400 Subject: [PATCH] bootc-ubuntu-setup: Preserve the original runner OS identity Installing Plucky packages can replace base-files and change os-release from Ubuntu 24.04 to 25.04. Reading it again afterward incorrectly skips the fixed Resolute QEMU installation. Capture the initial identity once and retain it for package selection. Assert the installed QEMU version in virtualization tests so a silently skipped upgrade cannot pass solely because a guest boots. Generated-by: AI Signed-off-by: Colin Walters --- .github/workflows/test-virtualization.yml | 13 +++++++++++++ bootc-ubuntu-setup/action.yml | 23 +++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-virtualization.yml b/.github/workflows/test-virtualization.yml index b674491..cf255ef 100644 --- a/.github/workflows/test-virtualization.yml +++ b/.github/workflows/test-virtualization.yml @@ -38,6 +38,19 @@ jobs: with: libvirt: true + - name: Verify installed QEMU package version + shell: bash + run: | + set -euo pipefail + case "$(dpkg --print-architecture)" in + amd64) qemu_package=qemu-system-x86 ;; + arm64) qemu_package=qemu-system-arm ;; + *) printf 'Unsupported architecture\n' >&2; exit 1 ;; + esac + version=$(dpkg-query -W -f='${Version}' "$qemu_package") + printf '%s version: %s\n' "$qemu_package" "$version" + dpkg --compare-versions "$version" ge 1:10.2 + - name: Verify host QEMU and select acceleration id: qemu shell: bash diff --git a/bootc-ubuntu-setup/action.yml b/bootc-ubuntu-setup/action.yml index fded1c4..2e0206f 100644 --- a/bootc-ubuntu-setup/action.yml +++ b/bootc-ubuntu-setup/action.yml @@ -8,6 +8,14 @@ inputs: runs: using: 'composite' steps: + - name: Capture initial runner OS + id: runner_os + shell: bash + run: | + set -euo pipefail + # Apt may upgrade base-files and rewrite /usr/lib/os-release later. + idv=$(. /usr/lib/os-release && printf '%s-%s' "$ID" "$VERSION_ID") + printf 'idv=%s\n' "$idv" >> "$GITHUB_OUTPUT" # The default runners have TONS of crud on them... - name: Free up disk space on runner shell: bash @@ -41,10 +49,12 @@ runs: # We really want support for heredocs - name: Install required packages shell: bash + env: + INITIAL_RUNNER_OS: ${{ steps.runner_os.outputs.idv }} run: | set -eux - IDV=$(. /usr/lib/os-release && echo ${ID}-${VERSION_ID}) - case "${IDV}" in + # Use the value captured before apt could replace base-files. + case "$INITIAL_RUNNER_OS" in ubuntu-24.04) # 24.04's podman is too old (no heredoc support, manifest bugs); # pull newer packages from plucky (25.04). @@ -93,7 +103,7 @@ runs: /bin/time -f '%E %C' sudo apt install -y just ;; *) - echo "Unsupported runner: ${IDV}" >&2 + echo "Unsupported runner: ${INITIAL_RUNNER_OS}" >&2 exit 1 ;; esac @@ -156,11 +166,12 @@ runs: - name: Install fixed QEMU from Ubuntu Resolute if: ${{ inputs.libvirt == 'true' }} shell: bash + env: + INITIAL_RUNNER_OS: ${{ steps.runner_os.outputs.idv }} run: | set -xeuo pipefail - idv=$(. /usr/lib/os-release && printf '%s-%s' "$ID" "$VERSION_ID") - if [ "$idv" != ubuntu-24.04 ]; then - printf 'Skipping Resolute QEMU setup on %s\n' "$idv" + if [ "$INITIAL_RUNNER_OS" != ubuntu-24.04 ]; then + printf 'Skipping Resolute QEMU setup on %s\n' "$INITIAL_RUNNER_OS" exit 0 fi case "$(dpkg --print-architecture)" in