diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-22 20:28:15 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-22 20:28:15 -0500 |
| commit | bed054f46e3b41aae0d599ed7fbc3e1e42d6ddd7 (patch) | |
| tree | 81a3a1fa97e44bb445bdf43877feeaffac1e4bff /scripts/test-install.sh | |
| parent | 0f8bbc7c1e2c2f6fec0b17753ac0d9c4a3ad4317 (diff) | |
| download | archangel-bed054f46e3b41aae0d599ed7fbc3e1e42d6ddd7.tar.gz archangel-bed054f46e3b41aae0d599ed7fbc3e1e42d6ddd7.zip | |
fix(build): clear stale archzfs from the pacoloco cache too
archzfs re-uploads its GitHub release assets under the same filename, so pacoloco keeps serving a zfs-dkms/zfs-utils it cached earlier while pacman fetches a fresh archzfs.db with a new checksum. The two mismatch and pacstrap aborts with "invalid or corrupted package." build.sh already drops the stale packages from the host pacman cache, but it never cleared the pacoloco layer, which the VM test installs route through too, so test-install.sh kept hitting the corruption (four times in one session).
build.sh runs as root, so it now clears /var/cache/pacoloco/pkgs/archzfs/zfs-* alongside the host cache, which makes the build-then-test flow self-healing. The pacoloco cache is root-owned and test-install.sh runs as the user, so it can't clear it unattended. Instead, test-install.sh now recognizes the corruption (is_archzfs_cache_corruption) and prints how to clear it, the way it already names the SSH_PORT override on a port collision. A retry alone won't help since it hits the same cached file, so this fails fast with the hint rather than retrying.
Diffstat (limited to 'scripts/test-install.sh')
| -rwxr-xr-x | scripts/test-install.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/test-install.sh b/scripts/test-install.sh index 4220d20..8d338b6 100755 --- a/scripts/test-install.sh +++ b/scripts/test-install.sh @@ -458,6 +458,19 @@ is_transient_install_failure() { <<<"$log" } +# Recognize the archzfs stale-cache corruption: archzfs re-uploads its +# GitHub release assets under the same filename, so a zfs-dkms/zfs-utils +# cached in the host pacoloco can mismatch the fresh archzfs.db checksum +# and pacstrap aborts with "invalid or corrupted package". Not transient +# (a retry hits the same cached file), so the caller prints a cache-clear +# hint rather than retrying. +is_archzfs_cache_corruption() { + local log="$1" + grep -q "Failed to install packages to new root" <<<"$log" || return 1 + grep -Eqi 'invalid or corrupted package|corrupted \(checksum\)' <<<"$log" || return 1 + grep -Eqi 'zfs-dkms|zfs-utils|archzfs' <<<"$log" +} + # Copy config to VM and run install run_install() { local config="$1" @@ -952,6 +965,10 @@ run_test() { fi else error "Installation failed or timed out" + if is_archzfs_cache_corruption "$install_log"; then + warn "Stale archzfs package in the host pacoloco cache (archzfs re-uploads same-filename assets)." + warn "Rebuild the ISO (build.sh clears it) or run: sudo rm -f /var/cache/pacoloco/pkgs/archzfs/zfs-* — then retry." + fi stop_vm "$config_name" # Save logs |
