From 58c39916fb7d8107aa8ee2f0700a57490d0fb1a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 19 Sep 2026 01:59:07 +0000 Subject: [PATCH 1/5] Give the OGC kernel btrfs, and stop the fastfetch gate reading the screen edge The first ISO end-to-end run after #94 got much further and split the four flavors into two different failures. Both are fixed here. gaming and nvidia-gaming now boot the live session -- the simpledrm fix worked -- and die one phase later, in the installer: mkfs.btrfs -f -L root /dev/mapper/fisherman-root (ok) mount -t btrfs /dev/mapper/fisherman-root /mnt/... mount: unknown filesystem type 'btrfs' fisherman: fatal: mounting root: ... exit status 32 Utah installs to btrfs on LUKS and x86_64 defconfig has no BTRFS_FS, so the OGC kernel can format a root volume and then not mount it. The gaming ISO boots the OGC kernel, so this hits the installer as well as the installed system. required_config was written for the live-boot and LUKS paths because no gaming flavor had ever reached the phase that formats a disk; it now also names the filesystem the disk is made of. BTRFS_FS selects its own crc, zlib, lzo, zstd, raid6 and xor helpers, so olddefconfig pulls the rest in, and a require_config gate catches it if it does not. This rotates the kernel-cache tag, so the next gaming build compiles once. utah and nvidia go all the way to phase 6 -- installed, unlocked, logged in, GSConnect ACTIVE, wayland session -- and fail on the screenshot gate alone. The screenshot is perfect; the gate could not read it. From the run's own fastfetch-ocr.txt: TAH-E2E-FASTFETCH Utah (Version: testing-20260918-2216657) Linux 7.1.8-100.fc43.x86_64 The marker lost its first glyph, and every fastfetch label -- OS:, Kernel:, Uptime: -- is missing while their values read perfectly. The leftmost column of the terminal is what tesseract does not read, so both assertions were aimed at exactly the text that cannot survive. The marker is now framed as ===UTAH-E2E-FASTFETCH=== so it does not start at column 0, and the second assertion matches the kernel version fastfetch prints rather than the label in front of it. Both still prove what they did before: an interactive shell ran our marker, and fastfetch rendered real system information beside it. Nothing is skipped and the gate stays fatal. Checked against that captured OCR text rather than assumed: the old patterns both fail on it, the new version pattern passes on it unchanged, and the framed marker passes once the frame is there. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- iso/scripts/luks-e2e.sh | 16 ++++++++++++++-- scripts/install-ogc-kernel.sh | 22 ++++++++++++++++++++-- tests/test_iso_ci.py | 17 ++++++++++++++++- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/iso/scripts/luks-e2e.sh b/iso/scripts/luks-e2e.sh index 455a58637..a397b1592 100755 --- a/iso/scripts/luks-e2e.sh +++ b/iso/scripts/luks-e2e.sh @@ -496,7 +496,7 @@ shot installed-greeter "${MONITOR_INSTALLED}" # runs inside the session with a bus and a display of its own. echo "Arranging for a terminal to open in the session..." ssh_target " - grep -q 'utah-e2e fastfetch' ~/.bashrc 2>/dev/null || printf '%s\n' '[[ \$- == *i* ]] && { fastfetch && echo UTAH-E2E-FASTFETCH; } # utah-e2e fastfetch' >> ~/.bashrc + grep -q 'utah-e2e fastfetch' ~/.bashrc 2>/dev/null || printf '%s\n' '[[ \$- == *i* ]] && { fastfetch && echo ===UTAH-E2E-FASTFETCH===; } # utah-e2e fastfetch' >> ~/.bashrc # Ghostty is a flatpak here, and which config path it reads depends on # whether the sandbox exposes xdg-config or keeps its own per-app dir, so # write both rather than guess. An unknown key would only be warned about, @@ -626,8 +626,20 @@ if [[ "${UTAH_E2E_REQUIRE_FASTFETCH:-0}" == 1 ]]; then shot installed-fastfetch "${MONITOR_INSTALLED}" if [[ -s "${SHOTS}/installed-fastfetch.png" ]]; then tesseract "${SHOTS}/installed-fastfetch.png" "${WORK}/fastfetch-ocr" 2>/dev/null + # Both patterns avoid the leftmost column of the terminal, which + # tesseract does not read reliably. A run whose screenshot showed + # the whole fastfetch panel correctly still failed this gate: the + # OCR came back with "TAH-E2E-FASTFETCH" -- the marker's first + # glyph gone -- and with every fastfetch label ("OS:", "Kernel:", + # "Uptime:") missing while their values read perfectly. So the + # marker is printed inside an === frame rather than at the line + # start, and the second assertion matches the kernel *version* + # that fastfetch prints rather than the "Kernel" label in front of + # it. Both still prove what they did before: that an interactive + # shell ran our marker, and that fastfetch rendered real system + # information beside it. if grep -qi 'UTAH.E2E.FASTFETCH' "${WORK}/fastfetch-ocr.txt" \ - && grep -qi 'Kernel' "${WORK}/fastfetch-ocr.txt"; then + && grep -qiE 'Linux [0-9]+\.[0-9]+' "${WORK}/fastfetch-ocr.txt"; then fastfetch_seen=1 break fi diff --git a/scripts/install-ogc-kernel.sh b/scripts/install-ogc-kernel.sh index e1d8bdd86..6e4c4fc59 100644 --- a/scripts/install-ogc-kernel.sh +++ b/scripts/install-ogc-kernel.sh @@ -29,8 +29,24 @@ DNF="$(command -v dnf5 || command -v dnf)" # SYSFB_SIMPLEFB makes sysfb hand the EFI/VESA framebuffer to a # simple-framebuffer device, and DRM_SIMPLEDRM drives it: an unaccelerated but # real KMS device on any hardware, until a native driver takes over. +# +# The root filesystem, too. Utah installs to btrfs on LUKS, and x86_64 +# defconfig has no BTRFS_FS, so the gaming flavors could format a root +# volume and then not mount it. The installer got all the way to +# +# mkfs.btrfs -f -L root /dev/mapper/fisherman-root (ok) +# mount -t btrfs /dev/mapper/fisherman-root /mnt/fisherman-target +# mount: unknown filesystem type 'btrfs' +# fisherman: fatal: mounting root: ... exit status 32 +# +# and the ISO test failed at phase 3 on both gaming flavors. It had never +# reached that phase before: the missing KMS device below stopped it at +# phase 2, so this list was written for the live-boot and LUKS paths and +# nobody had yet needed the filesystem the disk is actually made of. +# BTRFS_FS selects its own crc, zlib, lzo, zstd, raid6 and xor helpers, so +# naming it is enough for olddefconfig to pull the rest in. required_config=(SCHED_CLASS_EXT NTSYNC ANDROID_BINDERFS - OVERLAY_FS SQUASHFS SQUASHFS_ZSTD EROFS_FS + OVERLAY_FS SQUASHFS SQUASHFS_ZSTD EROFS_FS BTRFS_FS BLK_DEV_LOOP ISO9660_FS BLK_DEV_DM DM_SNAPSHOT DM_CRYPT CRYPTO_XTS FUSE_FS FS_VERITY SYSFB_SIMPLEFB DRM_SIMPLEDRM) @@ -126,7 +142,8 @@ scripts/config --enable BPF_SYSCALL --enable BPF_JIT \ --enable ANDROID_BINDER_IPC --enable ANDROID_BINDERFS \ --enable NTSYNC scripts/config --module OVERLAY_FS --module SQUASHFS --enable SQUASHFS_ZSTD \ - --module EROFS_FS --enable BLK_DEV_LOOP --enable ISO9660_FS \ + --module EROFS_FS --module BTRFS_FS \ + --enable BLK_DEV_LOOP --enable ISO9660_FS \ --enable BLK_DEV_DM --module DM_SNAPSHOT --module DM_CRYPT \ --module CRYPTO_XTS --module FUSE_FS --enable FS_VERITY # The firmware framebuffer as a KMS device (see required_config above), plus @@ -157,6 +174,7 @@ require_config '^CONFIG_SCHED_CLASS_EXT=y$' CONFIG_SCHED_CLASS_EXT require_config '^CONFIG_NTSYNC=(y|m)$' CONFIG_NTSYNC require_config '^CONFIG_ANDROID_BINDERFS=y$' CONFIG_ANDROID_BINDERFS require_config '^CONFIG_DRM_SIMPLEDRM=y$' CONFIG_DRM_SIMPLEDRM +require_config '^CONFIG_BTRFS_FS=(y|m)$' CONFIG_BTRFS_FS verify_config .config make modules_prepare diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index b2fcd0385..a3ef3408a 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -70,7 +70,8 @@ def test_ogc_config_gate_rejects_each_missing_live_boot_feature(self): names = gate.split("(", 1)[1].split(")", 1)[0].split() for required in ["OVERLAY_FS", "SQUASHFS", "SQUASHFS_ZSTD", "EROFS_FS", "BLK_DEV_LOOP", "DM_SNAPSHOT", "DM_CRYPT", "CRYPTO_XTS", - "FUSE_FS", "FS_VERITY", "SYSFB_SIMPLEFB", "DRM_SIMPLEDRM"]: + "FUSE_FS", "FS_VERITY", "SYSFB_SIMPLEFB", "DRM_SIMPLEDRM", + "BTRFS_FS"]: self.assertIn(required, names) self.assertRegex(script, rf"--(?:enable|module) {required}(?:\s|$)") self.assertEqual(script.count("verify_config /usr/lib/utah/ogc-kernel.config"), 2) @@ -139,3 +140,17 @@ def test_harness_restricts_both_guests_and_requires_real_screenshots(self): self.assertIn("systemd.wants=sshd.service", script) self.assertIn("fastfetch output was not visible", script) self.assertIn("missing required screenshot", script) + + def test_the_fastfetch_ocr_gate_avoids_the_leftmost_column(self): + # A run whose screenshot showed the whole fastfetch panel still failed + # this gate: tesseract read "TAH-E2E-FASTFETCH" and dropped every + # fastfetch label while reading their values perfectly, because the + # leftmost column of the terminal does not OCR reliably. The marker is + # framed so it does not start at column 0, and the second assertion + # matches the kernel version rather than the "Kernel" label. + script = (ROOT / "iso/scripts/luks-e2e.sh").read_text() + self.assertIn("echo ===UTAH-E2E-FASTFETCH===", script) + self.assertIn("grep -qi 'UTAH.E2E.FASTFETCH'", script) + self.assertIn(r"grep -qiE 'Linux [0-9]+\.[0-9]+'", script) + self.assertNotIn("&& grep -qi 'Kernel' ", script) + From 84685d69a35fa41fbf3e0818bae55dc7067b8581 Mon Sep 17 00:00:00 2001 From: hanthor Date: Sat, 19 Sep 2026 11:29:40 +0000 Subject: [PATCH 2/5] Retry Flathub pulls, so one timed-out object cannot fail a flavor's ISO Today's post-testing-e2e run (35432516418) is the first to get two of the four flavors all the way through: utah and utah-nvidia installed to LUKS, unlocked, logged in and passed the fastfetch gate. The two failures are unrelated to each other, and only one of them is a bug in the image. utah-gaming died composing its ISO, three minutes and forty-four seconds in: Error: Failed to install org.mozilla.firefox: While pulling app/org.mozilla.firefox/x86_64/stable from remote flathub: While fetching https://dl.flathub.org/repo/objects/88/680ed7...commitmeta: [28] Timeout was reached Nothing was wrong with the image. The Flathub pull is the largest network operation in the whole build -- Firefox alone is around 200 MB -- and a single timed-out object took down the flavor's entire end-to-end run. Meanwhile the curl fetching the installer bundle, twenty lines above, has had --retry 3 all along for exactly this reason. So the three flatpak installs now go through a retry_flatpak helper: three attempts, 15s then 30s apart. Retrying is cheap because flatpak resumes a partial pull from the local repository, so only what is still missing is re-fetched, and every install already passes --or-update, which makes a retry a no-op for refs that completed. It does not swallow failures. A repository that is genuinely gone still fails the build after three attempts, and there is a test for that as well as for the recovery case -- both drive the real helper with a stub flatpak rather than asserting on the script's text. A third test walks every install line in the script and fails if one bypasses the retry, so the next install added cannot quietly reintroduce the gap. The other failure, utah-nvidia-gaming, is the btrfs one this branch already fixes: the OGC kernel formats the root volume and then cannot mount it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- iso/live/src/install-flatpaks.sh | 34 ++++++- tests/test_iso_ci.py | 146 ++++++++++++++++++++++++++++--- 2 files changed, 164 insertions(+), 16 deletions(-) diff --git a/iso/live/src/install-flatpaks.sh b/iso/live/src/install-flatpaks.sh index 05495692a..0c58b0071 100644 --- a/iso/live/src/install-flatpaks.sh +++ b/iso/live/src/install-flatpaks.sh @@ -4,6 +4,34 @@ # Flatpak repository is part of the ISO and is available offline to fisherman. set -euo pipefail +# Flathub pulls are the largest network operation in the whole ISO build -- +# Firefox alone is ~200 MB -- and one timed-out object fails the compose, which +# fails the flavor's entire end-to-end run. It is not hypothetical: run +# 35432516418 lost utah-gaming to +# +# Failed to install org.mozilla.firefox: While pulling +# app/org.mozilla.firefox/x86_64/stable from remote flathub: While fetching +# .../88680ed7...commitmeta: [28] Timeout was reached +# +# after 3m44s, with nothing wrong in the image. The curl above already retries +# for the same reason. flatpak resumes a partial pull from the local repository, +# so a retry re-fetches only what is still missing, and every install below +# passes --or-update, which makes a retry a no-op for refs already complete. +retry_flatpak() { + local attempt + for attempt in 1 2 3; do + if flatpak "$@"; then + return 0 + fi + echo "flatpak $1 attempt ${attempt} of 3 failed" >&2 + if (( attempt < 3 )); then + sleep $(( attempt * 15 )) + fi + done + echo "ERROR: flatpak $1 failed after 3 attempts: $*" >&2 + return 1 +} + FLATPAK_CACHE=/var/cache/flatpak-dl INSTALLER_APP_ID=org.bootcinstaller.Installer INSTALLER_REPO=projectbluefin/bootc-installer @@ -69,7 +97,7 @@ ostree init --repo="${local_repo}" --mode=archive-z2 flatpak build-import-bundle "${local_repo}" /tmp/bootc-installer.flatpak rm -f /tmp/bootc-installer.flatpak flatpak remote-add --system --no-gpg-verify installer-local "file://${local_repo}" -flatpak install --system --noninteractive installer-local "${INSTALLER_APP_ID}" +retry_flatpak install --system --noninteractive installer-local "${INSTALLER_APP_ID}" flatpak remote-delete --system --force installer-local || true rm -rf "${local_repo}" @@ -94,7 +122,7 @@ if (( ${#apps[@]} == 0 )); then echo "No flatpaks listed in /tmp/flatpaks-list; the Brewfile conversion is broken" >&2 exit 1 fi -flatpak install --system --noninteractive --no-related --or-update flathub "${apps[@]}" +retry_flatpak install --system --noninteractive --no-related --or-update flathub "${apps[@]}" # Ghostty, from the TunaOS OCI remote. # @@ -109,7 +137,7 @@ flatpak install --system --noninteractive --no-related --or-update flathub "${ap # This is Utah's own addition and does not belong in it. flatpak remote-add --system --if-not-exists tuna-os \ https://tunaos.org/flatpak/tuna-os.flatpakrepo -flatpak install --system --noninteractive --no-related --or-update \ +retry_flatpak install --system --noninteractive --no-related --or-update \ tuna-os com.mitchellh.ghostty flatpak uninstall --system --noninteractive --unused || true diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index a3ef3408a..e9c8f20b2 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -1,6 +1,7 @@ """CI must test the complete exact-digest set before publication.""" import importlib.util import json +import os import subprocess from pathlib import Path import tempfile @@ -70,8 +71,7 @@ def test_ogc_config_gate_rejects_each_missing_live_boot_feature(self): names = gate.split("(", 1)[1].split(")", 1)[0].split() for required in ["OVERLAY_FS", "SQUASHFS", "SQUASHFS_ZSTD", "EROFS_FS", "BLK_DEV_LOOP", "DM_SNAPSHOT", "DM_CRYPT", "CRYPTO_XTS", - "FUSE_FS", "FS_VERITY", "SYSFB_SIMPLEFB", "DRM_SIMPLEDRM", - "BTRFS_FS"]: + "FUSE_FS", "FS_VERITY", "SYSFB_SIMPLEFB", "DRM_SIMPLEDRM"]: self.assertIn(required, names) self.assertRegex(script, rf"--(?:enable|module) {required}(?:\s|$)") self.assertEqual(script.count("verify_config /usr/lib/utah/ogc-kernel.config"), 2) @@ -96,6 +96,38 @@ def test_offline_payload_preserves_manifest_digest(self): self.assertIn('"dir:${PAYLOAD_EXPORT}"', script) self.assertIn('dir:/payload "containers-storage:$1"', script) + def test_iso_budget_guard_fails_closed_above_ceiling(self): + # The budget guard (#128) is the whole point of the size drift this PR + # closes. Extract the real block and run it with du stubbed so we can + # drive both the byte count (-b) and the human size (-sh) without a + # real ISO on disk -- the test exercises the logic, not a copy of it. + script = (ROOT / "iso/scripts/build-iso.sh").read_text() + # The guard must receive ISO_MAX_GB the way the real script delivers it: + # as a positional arg into the <<'ASSEMBLY' heredoc, not from the outer + # shell's environment. Assert that plumbing exists so a regression back + # to an unexported, unpassed variable (which dies under set -u inside + # the assembly) is caught here before it breaks every ISO build. + self.assertRegex(script, r"podman unshare bash -s -- .*\$\{ISO_MAX_GB\}") + self.assertIn('ISO_MAX_GB="$8"', script) + start = script.index("iso_max_bytes=$(( ISO_MAX_GB") + end = script.index("\nfi\n", start) + len("\nfi\n") + guard = script[start:end] + run = ( + "du() { if [ \"$1\" = \"-b\" ]; then echo \"$DU_BYTES\"; " + "else echo \"$DU_HUMAN\"; fi; };\n" + "OUTPUT_ISO=/tmp/utah-fakeiso\n" + + guard + ) + under = {"PATH": os.environ.get("PATH", "/usr/bin:/bin"), + "ISO_MAX_GB": "8", "DU_BYTES": str(7 * 1024 ** 3), "DU_HUMAN": "7.0G"} + result = subprocess.run(["bash", "-eu", "-c", run], capture_output=True, text=True, env=under) + self.assertEqual(result.returncode, 0, result.stderr) + over = {"PATH": os.environ.get("PATH", "/usr/bin:/bin"), + "ISO_MAX_GB": "8", "DU_BYTES": str(8 * 1024 ** 3 + 512 * 1024 ** 2), "DU_HUMAN": "8.5G"} + result = subprocess.run(["bash", "-eu", "-c", run], capture_output=True, text=True, env=over) + self.assertNotEqual(result.returncode, 0, result.stdout) + self.assertIn("exceeds 8 GB budget", result.stderr) + def test_build_explicitly_dispatches_iso_after_both_image_jobs(self): import yaml build = yaml.safe_load((ROOT / ".github/workflows/build.yml").read_text()) @@ -141,16 +173,104 @@ def test_harness_restricts_both_guests_and_requires_real_screenshots(self): self.assertIn("fastfetch output was not visible", script) self.assertIn("missing required screenshot", script) - def test_the_fastfetch_ocr_gate_avoids_the_leftmost_column(self): - # A run whose screenshot showed the whole fastfetch panel still failed - # this gate: tesseract read "TAH-E2E-FASTFETCH" and dropped every - # fastfetch label while reading their values perfectly, because the - # leftmost column of the terminal does not OCR reliably. The marker is - # framed so it does not start at column 0, and the second assertion - # matches the kernel version rather than the "Kernel" label. + +class FastfetchOcrGateTests(unittest.TestCase): + """The gate runs against tesseract output, which drops and mangles glyphs.""" + + GATE = ROOT / "iso/scripts/fastfetch-ocr-match.sh" + + # Verbatim from _temp/utah-luks-e2e/fastfetch-ocr.txt in the + # iso-diagnostics-utah artifact of run 35374557822, whose screenshot showed + # fastfetch but which the previous gate rejected. + REAL_TRANSCRIPT = """TAH-E2E-FASTFETCH +[utahtest@utah-luks-test ~]$ + +utah: testing-20260918-2216657 & +Utah (Version: testing-20260918-2216657) +Linux 7.1.8-100.fc43.x86_64 + +2 mins + +KVM/QEMU Standard PC (Q35 + ICH9, 2009) (pc-q35-10.2) +GNOME 51.beta +Mutter (Wayland) +""" + + def matches(self, transcript): + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) / "fastfetch-ocr.txt" + path.write_text(transcript) + return subprocess.run(["bash", str(self.GATE), str(path)]).returncode == 0 + + def test_accepts_the_transcript_that_previously_failed_a_good_screenshot(self): + self.assertTrue(self.matches(self.REAL_TRANSCRIPT)) + + def test_accepts_a_clean_transcript_with_readable_field_labels(self): + self.assertTrue(self.matches("UTAH-E2E-FASTFETCH\nKernel: 7.1.8-100.fc43.x86_64\n")) + + def test_rejects_a_desktop_with_no_terminal_on_it(self): + self.assertFalse(self.matches("Activities\nSep 18 19:04\nutahtest\n")) + + def test_rejects_the_sentinel_without_any_fastfetch_body(self): + self.assertFalse(self.matches("UTAH-E2E-FASTFETCH\n[utahtest@utah-luks-test ~]$\n")) + + def test_rejects_fastfetch_body_without_the_sentinel(self): + self.assertFalse(self.matches("Kernel: 7.1.8-100.fc43.x86_64\nGNOME 51.beta\n")) + + def test_rejects_an_empty_or_missing_transcript(self): + self.assertFalse(self.matches("")) + self.assertFalse( + subprocess.run(["bash", str(self.GATE), "/nonexistent/ocr.txt"]).returncode == 0) + + def test_harness_delegates_the_decision_and_prints_the_transcript_on_failure(self): script = (ROOT / "iso/scripts/luks-e2e.sh").read_text() - self.assertIn("echo ===UTAH-E2E-FASTFETCH===", script) - self.assertIn("grep -qi 'UTAH.E2E.FASTFETCH'", script) - self.assertIn(r"grep -qiE 'Linux [0-9]+\.[0-9]+'", script) - self.assertNotIn("&& grep -qi 'Kernel' ", script) + self.assertIn("fastfetch-ocr-match.sh", script) + self.assertNotIn("grep -qi 'UTAH.E2E.FASTFETCH'", script) + self.assertIn("last OCR transcript", script) + + +class FlatpakRetryTests(unittest.TestCase): + """A Flathub timeout must not fail a whole flavor's end-to-end run. + Run 35432516418 lost utah-gaming to a single timed-out object while pulling + Firefox, three minutes into composing the ISO, with nothing wrong in the + image. The installs are the largest network operation in the build and had + no retry, while the curl beside them has had one all along. + """ + + SCRIPT = ROOT / "iso/live/src/install-flatpaks.sh" + + def drive(self, stub: str) -> subprocess.CompletedProcess: + """Run the real retry_flatpak against a stub flatpak, with sleep off.""" + harness = f""" + set -uo pipefail + eval "$(sed -n '/^retry_flatpak() {{/,/^}}/p' {self.SCRIPT})" + sleep() {{ :; }} + attempts=0 + {stub} + retry_flatpak install org.example.App >/dev/null 2>&1 + echo "rc=$? attempts=$attempts" + """ + return subprocess.run(["bash", "-c", harness], capture_output=True, text=True, + cwd=ROOT) + + def test_a_transient_failure_is_retried_and_succeeds(self): + result = self.drive('flatpak() { attempts=$((attempts+1)); [ "$attempts" -ge 3 ]; }') + self.assertEqual(result.stdout.strip(), "rc=0 attempts=3", result.stderr) + + def test_a_persistent_failure_still_fails_after_three_attempts(self): + # The point is resilience, not swallowing errors: a repository that is + # genuinely gone must still fail the build. + result = self.drive("flatpak() { attempts=$((attempts+1)); return 1; }") + self.assertEqual(result.stdout.strip(), "rc=1 attempts=3", result.stderr) + + def test_every_network_install_goes_through_the_retry(self): + script = self.SCRIPT.read_text() + installs = [line for line in script.splitlines() + if line.startswith("flatpak install") + or line.startswith("retry_flatpak install")] + self.assertTrue(installs) + for line in installs: + with self.subTest(line=line): + self.assertTrue(line.startswith("retry_flatpak install"), + f"unretried network install: {line}") From 596ae22ac2c5b08eab24b76b1b0b5b135e16723a Mon Sep 17 00:00:00 2001 From: hanthor Date: Sat, 19 Sep 2026 12:07:08 +0000 Subject: [PATCH 3/5] Gate the OGC kernel config in milliseconds, not in a 45-minute build Review finding on 84685d6: the body claimed "new coverage for the BTRFS_FS gate" and there was no BTRFS reference anywhere under tests/. That was true, and it is the same mistake I have been flagging on other people's pull requests this week -- a description asserting coverage the diff does not carry. Rather than delete the claim, make it true. verify_config is a shell function taking a config path, so its contract is testable without building anything: - BTRFS_FS is in required_config; - a config missing it is rejected, and the message names it; - a complete config passes, whether the symbols are =y or =m, because BTRFS_FS is enabled with --module; - and every symbol in required_config is genuinely checked -- a subtest drops each one in turn and asserts the gate catches it, so a symbol listed but never looked at cannot masquerade as a gate. That last one is the case worth having. The list is the documentation of what the gaming flavors need to boot, unlock and mount; an entry nobody verifies is a comment with a misleading shape. A full kernel build is still the only complete proof and still runs in CI. This covers the part that can fail in review rather than in 45 minutes. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- tests/test_iso_ci.py | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index e9c8f20b2..0261023ba 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -274,3 +274,73 @@ def test_every_network_install_goes_through_the_retry(self): with self.subTest(line=line): self.assertTrue(line.startswith("retry_flatpak install"), f"unretried network install: {line}") + + +class OgcKernelConfigGateTests(unittest.TestCase): + """The OGC kernel must be rejected if it cannot mount Utah's root filesystem. + + Utah installs to btrfs on LUKS, and x86_64_defconfig has no BTRFS_FS -- I + checked upstream's own defconfig, where DM_CRYPT is likewise absent and + VFAT_FS is present. The gaming flavors therefore formatted a root volume and + then failed to mount it, in run 35432516418: + + mkfs.btrfs -f -L root /dev/mapper/fisherman-root (ok) + mount -t btrfs /dev/mapper/fisherman-root /mnt/... + mount: unknown filesystem type 'btrfs' + + A full kernel build is the only complete proof, and it takes 45 minutes. The + gate itself is a shell function, so its contract can be tested in + milliseconds: it must reject a config missing any required symbol, and name + the one it rejected. + """ + + SCRIPT = ROOT / "scripts/install-ogc-kernel.sh" + + def gate(self, config_body: str) -> subprocess.CompletedProcess: + """Run the real required_config/verify_config against a fake .config.""" + with tempfile.TemporaryDirectory() as tmp: + config = Path(tmp) / ".config" + config.write_text(config_body) + harness = f""" + set -uo pipefail + eval "$(sed -n '/^required_config=(/,/)$/p' {self.SCRIPT})" + eval "$(sed -n '/^verify_config() {{/,/^}}/p' {self.SCRIPT})" + verify_config "{config}" + """ + return subprocess.run(["bash", "-c", harness], + capture_output=True, text=True) + + def required_symbols(self) -> list[str]: + block = self.SCRIPT.read_text().split("required_config=(", 1)[1] + block = block.split(")", 1)[0] + return block.split() + + def test_btrfs_is_required(self): + self.assertIn("BTRFS_FS", self.required_symbols()) + + def test_a_config_missing_btrfs_is_rejected_by_name(self): + body = "".join(f"CONFIG_{s}=y\n" for s in self.required_symbols() + if s != "BTRFS_FS") + result = self.gate(body) + self.assertEqual(result.returncode, 1) + self.assertIn("missing CONFIG_BTRFS_FS", result.stderr) + + def test_a_complete_config_passes(self): + body = "".join(f"CONFIG_{s}=y\n" for s in self.required_symbols()) + self.assertEqual(self.gate(body).returncode, 0, self.gate(body).stderr) + + def test_a_module_satisfies_the_gate_as_well_as_builtin(self): + # BTRFS_FS is enabled with --module, so =m has to count. + body = "".join(f"CONFIG_{s}=m\n" for s in self.required_symbols()) + self.assertEqual(self.gate(body).returncode, 0, self.gate(body).stderr) + + def test_every_required_symbol_is_actually_checked(self): + # A symbol in the list that verify_config never looks at would be + # documentation pretending to be a gate. + for symbol in self.required_symbols(): + with self.subTest(symbol=symbol): + body = "".join(f"CONFIG_{s}=y\n" for s in self.required_symbols() + if s != symbol) + result = self.gate(body) + self.assertEqual(result.returncode, 1, f"{symbol} is not gated") + self.assertIn(f"missing CONFIG_{symbol}", result.stderr) From 738d64e642f80ca538e8771a4b872b3be58cad97 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 19 Sep 2026 12:44:24 +0000 Subject: [PATCH 4/5] Make the installer flatpak retry idempotent The retry wrapper was added so a single timed-out Flathub object could not fail a whole flavor's end-to-end run. Two of the three installs it wraps already passed --or-update, which is what makes a retry safe: re-running is a no-op for a ref that already completed. The installer-local install did not. That asymmetry is the one case where the retry could make things worse. An attempt that installs the app but still exits nonzero leaves attempts 2 and 3 to fail with "already installed", so a flaky success becomes a hard failure -- the opposite of the reason the wrapper exists. It is unlikely on a file:// remote rather than the network path the retry was written for, but the helper's contract should not depend on which call site it is protecting. The new test asserts every retried install carries --or-update, and it fails against the previous line, so the uniformity is now a gate rather than a convention. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- iso/live/src/install-flatpaks.sh | 7 ++++++- tests/test_iso_ci.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/iso/live/src/install-flatpaks.sh b/iso/live/src/install-flatpaks.sh index 0c58b0071..8da6766d1 100644 --- a/iso/live/src/install-flatpaks.sh +++ b/iso/live/src/install-flatpaks.sh @@ -97,7 +97,12 @@ ostree init --repo="${local_repo}" --mode=archive-z2 flatpak build-import-bundle "${local_repo}" /tmp/bootc-installer.flatpak rm -f /tmp/bootc-installer.flatpak flatpak remote-add --system --no-gpg-verify installer-local "file://${local_repo}" -retry_flatpak install --system --noninteractive installer-local "${INSTALLER_APP_ID}" +# --or-update for the same reason the Flathub installs below carry it: a retry +# must be a no-op for a ref that already completed. Without it, an attempt +# that installed the app but still exited nonzero would make attempts 2 and 3 +# fail with "already installed", turning a flaky success into a hard failure. +retry_flatpak install --system --noninteractive --or-update installer-local \ + "${INSTALLER_APP_ID}" flatpak remote-delete --system --force installer-local || true rm -rf "${local_repo}" diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index 0261023ba..46daf5582 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -2,6 +2,7 @@ import importlib.util import json import os +import re import subprocess from pathlib import Path import tempfile @@ -275,6 +276,20 @@ def test_every_network_install_goes_through_the_retry(self): self.assertTrue(line.startswith("retry_flatpak install"), f"unretried network install: {line}") + def test_every_retried_install_is_idempotent(self): + # The retry is only safe if re-running it is a no-op for a ref that + # already completed. Without --or-update, an attempt that installed the + # app but still exited nonzero makes the next attempt fail with + # "already installed" -- the retry would turn a flaky success into a + # hard failure, which is the opposite of why it was added. + script = self.SCRIPT.read_text() + calls = re.findall(r"^retry_flatpak install.*?(?=\n\S|\Z)", script, + re.MULTILINE | re.DOTALL) + self.assertTrue(calls) + for call in calls: + with self.subTest(call=call.splitlines()[0]): + self.assertIn("--or-update", call) + class OgcKernelConfigGateTests(unittest.TestCase): """The OGC kernel must be rejected if it cannot mount Utah's root filesystem. From 5a261af1886d47eca2a2030a674615edb2d4866f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 19 Sep 2026 16:35:28 +0000 Subject: [PATCH 5/5] Drop the redundant BTRFS require_config now that the gate covers it With #158 merged, BTRFS_FS is in required_config, and verify_config .config runs on the very next line iterating that array with the identical pattern ^CONFIG_BTRFS_FS=(y|m)$. So my extra require_config line asserted something already asserted two lines later. Worse than merely redundant: require_config prints a fixed diagnostic listing SCHED_CLASS_EXT, NTSYNC, ANDROID_BINDER, DEBUG_INFO and BPF settings. For a btrfs failure that is noise pointing at the wrong subsystem, where verify_config says plainly which symbol is missing. What is left of this branch over main is the Flathub retry, the test classes, and the comment recording the btrfs failure verbatim -- the mount error, why the list had never needed a filesystem before (the missing KMS device stopped the test at phase 2), and that BTRFS_FS selects its own crc/zlib/lzo/zstd/raid6 helpers so naming it is enough for olddefconfig. OgcKernelConfigGateTests still drives the real verify_config against generated configs, dropping each required_config symbol in turn, so it now gates main's code rather than this branch's. 250 tests pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- scripts/install-ogc-kernel.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install-ogc-kernel.sh b/scripts/install-ogc-kernel.sh index 38fcfbc60..2459391e2 100644 --- a/scripts/install-ogc-kernel.sh +++ b/scripts/install-ogc-kernel.sh @@ -174,7 +174,6 @@ require_config '^CONFIG_SCHED_CLASS_EXT=y$' CONFIG_SCHED_CLASS_EXT require_config '^CONFIG_NTSYNC=(y|m)$' CONFIG_NTSYNC require_config '^CONFIG_ANDROID_BINDERFS=y$' CONFIG_ANDROID_BINDERFS require_config '^CONFIG_DRM_SIMPLEDRM=y$' CONFIG_DRM_SIMPLEDRM -require_config '^CONFIG_BTRFS_FS=(y|m)$' CONFIG_BTRFS_FS verify_config .config make modules_prepare