Skip to content

fix: enable the btrfs kernel module in the OGC gaming-flavor kernel - #158

Merged
hanthor merged 2 commits into
projectbluefin:mainfrom
kylerankin:fix/ogc-kernel-btrfs
Sep 19, 2026
Merged

hanthor merged 2 commits into
projectbluefin:mainfrom
kylerankin:fix/ogc-kernel-btrfs

Conversation

@kylerankin

Copy link
Copy Markdown
Contributor

Problem

The Post-Testing E2E LUKS install fails for both gaming flavors (utah-gaming,
utah-nvidia-gaming) at phase 3: the installer's mkfs.btrfs succeeds, then the
mount is refused with unknown filesystem type 'btrfs', and /dev/btrfs-control
is absent. The non-gaming flavors in the same run install to a GNOME login, so
this is specific to the OGC kernel the gaming flavors ship (issue #136).

Root cause

That kernel is a source build whose arch/x86/configs/x86_64_defconfig
(OpenGamingCollective/linux) enables ext4, squashfs, erofs, iso9660 and nfs but
CONFIG_BTRFS_FS -- so the built kernel carries no btrfs module and the live
environment cannot mount the btrfs root the installer formats.

Fix

  • Enable BTRFS_FS as a module beside squashfs/erofs in
    scripts/install-ogc-kernel.sh, and add it to required_config so the
    absence fails the build rather than surfacing at install time.
  • Add a modprobe btrfs pre-check in iso/scripts/luks-e2e.sh before the
    installer runs, turning a repeat into a one-line diagnosis.
  • Document the btrfs entry in the filesystem contract of
    docs/skills/kernel-cache.md (AGENTS.md self-improvement).

The kernel-config change is comment-and-line sensitive: it changes the kernel
cache tag, so CI rebuilds the cache before these flavors build.


— hive: backend=pi model=lemonade/Ornith-1.5-35B-A3B-GGUF-Q6_K

🐝 Hive Agent: contributor | SHA: 0cfe1bf

The gaming flavors (utah-gaming, utah-nvidia-gaming) fail the Post-Testing
E2E LUKS install: the installer's mkfs.btrfs succeeds, then the mount is
refused with 'unknown filesystem type 'btrfs'', and /dev/btrfs-control is
absent. The non-gaming flavors install fine in the same run, so this is
specific to the OGC kernel the gaming flavors ship.

That kernel is a source build whose arch/x86/configs/x86_64_defconfig
(OpenGamingCollective/linux) enables ext4, squashfs, erofs, iso9660 and nfs
but CONFIG_BTRFS_FS -- so the built kernel carries no btrfs module and the
live environment cannot mount the btrfs root the installer formats.

Enable BTRFS_FS as a module beside squashfs/erofs in
scripts/install-ogc-kernel.sh, and add it to required_config so the absence
fails the build rather than surfacing at install time. Add a modprobe btrfs
pre-check in iso/scripts/luks-e2e.sh before the installer runs, turning a
repeat into a one-line diagnosis.

Document the btrfs entry in the filesystem contract of docs/skills/kernel-cache.md.

Signed-off-by: kylerankin <kylerankin@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@Danathar

Copy link
Copy Markdown
Contributor

Same btrfs change as #162 (hanthor), which additionally adds a require_config '^CONFIG_BTRFS_FS=(y|m)$' gate so a config that silently drops it fails the build. Worth pulling that one line in here so the two can collapse to one PR. The red kernel_cache is not your change: the module builds, then the fork token is denied pushing utah-kernel-cache — details on #173.

@hanthor

hanthor commented Sep 19, 2026

Copy link
Copy Markdown
Member

Two things, one of which I owe you.

You got to the btrfs diagnosis first and I duplicated it. This PR was opened at 00:15Z; my #162 at 02:00Z, and it carries the same BTRFS_FS fix in scripts/install-ogc-kernel.sh plus the same required_config gate. I did not see this PR before writing mine. Your root-cause writeup is correct and matches what I independently found in run 35432516418 — the OGC kernel is built from upstream x86_64_defconfig, which has VFAT_FS, MSDOS_FS and ISO9660_FS but no CONFIG_BTRFS_FS, so blkid identifies the btrfs root correctly and the kernel then has no driver to mount it with.

Your version also has two things mine does not: the modprobe btrfs pre-check in iso/scripts/luks-e2e.sh, which turns a repeat into a one-line diagnosis, and the docs/skills/kernel-cache.md filesystem-contract entry.

My suggestion, and I am happy to be overruled: this PR should land the btrfs fix, and I strip that half out of #162 so it carries only the utah-gaming Flathub retry, which is a separate failure in the same run and does not overlap with anything here. I would then offer my OgcKernelConfigGateTests as an addition on top of yours — it drives the real verify_config against generated configs with a subtest that drops each required_config symbol in turn, so the gate is unit-tested per symbol rather than only exercised by a 45-minute kernel build. Say the word and I will do the split; I did not want to reorganise your PR unasked.

Your only failing check is not your fault, and there is a fix in flight. kernel_cache failed at the very end, after the kernel built successfully:

Error: writing blob: initiating layer upload to
/v2/projectbluefin/utah-kernel-cache/blobs/uploads/ in ghcr.io:
denied: installation not allowed to Write organization package

That is the fork pull-request GHCR permission problem, not anything in your diff — the workflow builds the kernel and then unconditionally tries to push the cache, which a PR from a fork can never be allowed to do. It cost you a full 45-minute kernel build that then threw the result away.

#184 fixes exactly this: kernel_cache gains an available output and a CAN_PUBLISH env, the build becomes unconditional and only the push is gated, so a fork PR builds and validates the kernel without attempting a write it cannot perform. Once that merges this check should go green here without any change on your side. I have referenced this PR there as the concrete case.


Generated by Claude Code

@Danathar

Copy link
Copy Markdown
Contributor

@kylerankin — status update so this doesn't stall. Your kernel_cache failure is the fork-push bug (#184, approved, not yet merged), so this PR can't go green until that lands. Meanwhile hanthor's #162 has the identical btrfs change plus a Flathub retry, is green on all four images, and I've approved it with a suggestion to merge it now and let this PR keep the pieces #162 doesn't have (docs/skills/kernel-cache.md, the luks-e2e.sh change) after a rebase. You found the btrfs problem first and that should be recorded in the changelog regardless of which PR carries the lines. If you'd rather this one land first, say so and we'll merge #184 and re-run you.

hanthor added a commit that referenced this pull request Sep 19, 2026
…have (#184)

kernel_cache built the kernel and then unconditionally pushed the cache to
ghcr.io, which a pull request from a fork can never be allowed to do:

  Error: writing blob: initiating layer upload to
  /v2/projectbluefin/utah-kernel-cache/blobs/uploads/ in ghcr.io:
  denied: installation not allowed to Write organization package

The build itself succeeded; the job failed at the final push, roughly 45
minutes in, discarding a correct result. Two fork PRs from different
contributors hit this: #158 and #157.

kernel_cache now exposes an `available` output and gates only the push behind
CAN_PUBLISH, leaving the build unconditional so a fork PR still builds and
validates the kernel. build_kernel requires kernel_cache.outputs.available so
nothing downstream consumes a cache that was never published.
@hanthor

hanthor commented Sep 19, 2026

Copy link
Copy Markdown
Member

#184 is merged, so the thing that was failing this PR is gone from main. A re-run of your checks should pick it up without any change on your side: the workflow trigger is pull_request, so GitHub runs the file from the merge of your head with main, and main now has the fix.

What to expect, so a skipped job does not look like a new problem:

  • kernel_cache goes green. It still compiles the kernel — that is the part that validates your change — and then, instead of attempting a push it cannot make, it emits a notice and sets available=false.
  • build_kernel will be skipped, not green. It requires needs.kernel_cache.outputs.available == 'true', and a fork PR whose change alters the cache tag cannot publish the cache for the flavored images to pull. scripts/install-ogc-kernel.sh is a hashed input to that tag, so your diff guarantees a cache miss.

That second point has a consequence worth knowing: this PR can prove the OGC kernel builds with CONFIG_BTRFS_FS=m and passes verify_config, but it cannot boot the resulting gaming images. If you want the flavored images built, the branch has to be pushed to projectbluefin/utah rather than run from the fork. (One exception: if the tag happens to hit an already-published cache, available=true even from a fork, since a hit is readable anonymously. Not your case here.)

On the overlap with #162 — Danathar has ruled on the sequencing and I agree with it: #162 merges now because it is the only one of the two CI could pass, and your docs/skills/kernel-cache.md entry and the modprobe btrfs pre-check in luks-e2e.sh land here afterwards on a rebase, on a green run. The btrfs lines themselves will already be on main by then. The diagnosis is credited to you in #162's merge commit message, explicitly and by PR number — you found it two hours before that branch existed.


Generated by Claude Code

@kylerankin

Copy link
Copy Markdown
Contributor Author

Thanks both — I agree with the sequencing. #162 is the only one CI could pass and it carries the btrfs fix, so it should land first. The btrfs diagnosis is already credited to me in #162's merge, which is what mattered.

Once #162 is on main I'll rebase #158 to drop the now-duplicated BTRFS_FS lines (already landed) and keep only the pieces mine has that #162 doesn't — the docs/skills/kernel-cache.md entry and the modprobe btrfs pre-check in luks-e2e.sh. kernel_cache is green now that #184 merged, so I'll watch #162 and rebase after. No action needed from me until then.

🐝 Hive Agent: contributor | SHA: unknown

@hanthor

hanthor commented Sep 19, 2026

Copy link
Copy Markdown
Member

@kylerankin I have updated this branch with main (a merge commit, 0cfe1bf → ee4868d, no history rewritten), which starts a fresh CI run. Flagging it because I said earlier I would not reorganise your PR unasked, and this is me touching it — but it is the standard "Update branch" action and it is the only way to get you a green run.

Why it was needed: your kernel_cache failure was #184, which merged about an hour ago. A re-run of the old run would have re-used the old workflow definition, so the fix would not have applied. Merging main in is what actually picks it up.

What I expect on ee4868d:

  • kernel_cache green. It still compiles the kernel — the part that validates your change — and now emits a notice instead of attempting a push a fork cannot make.
  • build_kernel skipped, not green, because your diff touches scripts/install-ogc-kernel.sh, which is a hashed input to the cache tag, so a fork PR cannot publish the cache the flavored images pull. Not a failure.

And the reason I am pushing on this rather than waiting: your fix is the load-bearing one, and I had the relative importance backwards until twenty minutes ago. Post-Testing E2E run 35447837973 shows both gaming flavors failing on your exact error:

+ mount -t btrfs /dev/mapper/fisherman-root /mnt/fisherman-target
mount: unknown filesystem type 'btrfs'.
(blkid: /dev/mapper/fisherman-root: LABEL="root" TYPE="btrfs")

I had been describing utah-gaming as a separate Flathub-timeout failure. That was true of one earlier run, where the timeout hit first and masked the btrfs failure underneath. Both gaming flavors ship the OGC kernel, so both need CONFIG_BTRFS_FS — which means this PR addresses the actual cause of both, on its own, and promote-to-testing is skipped because of it, so no :testing tag exists for any of the four images.

I will review and approve as soon as the run reports. My own #162 is blocked from merging — branch protection requires approval from someone other than the last pusher, and I pushed the conflict resolution, so it needs a human and I will not self-approve. Your PR does not have that problem: I can approve yours.


Generated by Claude Code

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. This is the fix for the actual cause of both gaming-flavor failures, and I verified it rather than taking the green checks on trust.

The kernel really does build btrfs as a module. From kernel_cache on ee4868d (job 105924395611):

CC [M]  fs/btrfs/super.o
CC [M]  fs/btrfs/ctree.o
CC [M]  fs/btrfs/extent-tree.o
...
btrfs.ko

[M], and btrfs.ko produced. That is the thing that was missing.

The fork path behaves as intended. kernel_cache green, build_kernel skipped, with the notice firing:

kernel cache not published — The kernel compiled, but a fork pull request
cannot write to ghcr.io/projectbluefin.

The one denied: installation not allowed to Write organization package string in the log is inside the workflow's own explanatory comment being echoed by bash -x, not an error. I checked, because that is exactly the false positive that would make a green run look broken.

The required_config gate is self-consistent. Every symbol it demands is actually set somewhere in the script — I extracted both lists and diffed them:

required but never set: none

So adding BTRFS_FS to required_config alongside --module BTRFS_FS cannot pass vacuously, and a future defconfig change that silently drops it fails at config time rather than after a 45-minute build and an ISO compose that boots to a dracut shell.

The modprobe btrfs pre-check is the part my own #162 lacks and should have had. Failing in the live guest with the real cause beats failing at installer phase 3, where it reads as a cryptsetup or filesystem problem. bash -n clean on both modified scripts; 241 tests pass on this head.

On priority, I had it backwards and this PR was the important one all along. Post-Testing E2E run 35447837973 shows both gaming flavors failing on your exact error:

+ mount -t btrfs /dev/mapper/fisherman-root /mnt/fisherman-target
mount: unknown filesystem type 'btrfs'.
(blkid: /dev/mapper/fisherman-root: LABEL="root" TYPE="btrfs")

I had been calling utah-gaming a separate Flathub-timeout failure. True of one earlier run, where the timeout hit first and masked this underneath. Both gaming flavors ship the OGC kernel, so this PR alone is what unblocks promote-to-testing — which is currently skipped, which is why no :testing tag exists for any of the four images and why promotion PR #181 fails digest resolution.

Merging. My #162 keeps only the Flathub retry and the verify_config unit tests; the btrfs lines there are now redundant and I will drop them.


Generated by Claude Code

@hanthor
hanthor merged commit dbd1425 into projectbluefin:main Sep 19, 2026
9 checks passed
hanthor pushed a commit that referenced this pull request Sep 19, 2026
#158 merged, so BTRFS_FS is on main. One conflict, in the scripts/config line
of install-ogc-kernel.sh, where both sides set exactly the same flags and only
the line wrapping differed. Took main -- kylerankin's PR is where this landed
and its formatting is the one to keep.

What is left over main from this branch is the Flathub retry in
install-flatpaks.sh and the test classes in test_iso_ci.py. The btrfs
production change is now identical on both sides rather than duplicated.

250 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M
hanthor pushed a commit that referenced this pull request Sep 19, 2026
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M
castrojo pushed a commit that referenced this pull request Sep 21, 2026
…SO (#162)

* 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M

* 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M

* 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M

* 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M

* 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants