Skip to content

feat(kernel): drop firmware-less Wi-Fi, Bluetooth and GPU drivers; compress vmlinuz with zstd - #491

Merged
jeefy merged 3 commits into
projectbluefin:mainfrom
jeefy:feat/kernel-trim-zstd
Oct 18, 2026
Merged

jeefy merged 3 commits into
projectbluefin:mainfrom
jeefy:feat/kernel-trim-zstd

Conversation

@jeefy

@jeefy jeefy commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Follows #489 with the kernel-side half of the size review. −24 MB usr.raw, −4.3 MB per UKI vs current main; the trimmed image boots in just dogfood-check (Secure Boot, verity, lockdown=integrity, failed=0).

What

New patches/freedesktop-sdk/0009-linux-server-no-firmware-hw.patch, appended after 0007. The image ships no /usr/lib/firmware, so Wi-Fi (CFG80211/MAC80211 + every WLAN driver), BT, and DRM_AMDGPU/RADEON/NOUVEAU/XE cannot bind the hardware they drive; they are removed from the kernel config. KERNEL_GZIP → KERNEL_ZSTD. The kernel is already built off FSDK's cache because of 0006/0007, so this adds no new cache miss — but every full build after this PR rebuilds the kernel once (18 min locally).

The subtle part: FSDK's own config lines put ~190 of those drivers into its expected-configs check, which fails the build on any unset option. The patch snapshots which expected options are set, applies the removes + olddefconfig, and drops from the check exactly the options that went set→unset (192, printed in the build log) — everything else FSDK expects is still enforced. A stub-helper test proves only true dependents leave the check and an expected-but-missing option still fails.

Kept / not touched

DEBUG_INFO_BTF (Cilium CO-RE), RFKILL (x86 platform drivers), i915, simpledrm, virtio-gpu, hyperv_drm, vmwgfx, vboxvideo, ttm/gpu-sched. Sound (360 modules), media (212), IIO (127), input (73) are unchanged — that is the separate "M2" product decision. ast/mgag200/bochs were never built in this kernel, so there was nothing to keep. One side effect: cec.ko (HDMI-CEC, 40 KB) also drops because only amdgpu's display code selected CEC_CORE.

Removed: 201 module files / 23.9 MB (Wi-Fi 160 / 13.0 MB, amdgpu 6.1, xe 1.9, nouveau 1.3, radeon 0.9, Bluetooth 27 / 0.6). Added: libarc4.ko (5 KB; was built in via mac80211). Nouveau's absence makes nvidia-load's modprobe -r nouveau a no-op; docs and comments updated, code unchanged.

v26.10.1215 main (local build of b3e4b0d) this PR
usr.raw 215,330,816 211,357,696 187,297,792
disk UKI 93,467,568 79,671,296 75,356,672
.linux in UKI 20.7 MB gzip 20.7 MB gzip 16.4 MB zstd

Verification

0001/0006/0007/0008/0009 apply in order on a clean freedesktop-sdk-26.08.2 with no offsets; just validate; just export-image (kernel rebuilt; FSDK's expected-config check passed); just check-image vs both v26.10.1215 and main baselines; just dogfood-check passes; pytest 1501 (new test_kernel_no_firmware.py, patch-chain fixture extended, build-trigger case); ruff, docs-checks. patches/README.md row + bump-fsdk-version.md updated — this patch will need refreshing on FSDK bumps that touch fdsdk-config.sh's tail, same as 0006/0007. full-build added for CI's boot-test.

jeefy and others added 2 commits October 17, 2026 20:05
…mpress vmlinuz with zstd

The image ships no /usr/lib/firmware, so Wi-Fi, Bluetooth and the amdgpu,
radeon, nouveau and xe GPU drivers cannot drive the hardware they match.
patches/freedesktop-sdk/0009 appends to FSDK's fdsdk-config.sh after 0007:
it removes WLAN, CFG80211, MAC80211, BT, DRM_AMDGPU, DRM_RADEON,
DRM_NOUVEAU and DRM_XE, and switches KERNEL_GZIP to KERNEL_ZSTD.

FSDK's module/enable lines put those drivers in expected-configs, so the
block snapshots the expected options that are set, runs olddefconfig, and
drops from the check only the ones that went from set to unset (192, listed
in the build log; matching a local Kconfig run of 7.2.6). Every other
expected option is still checked. CEC_CORE/MEDIA_CEC_RC go too: only
amdgpu's display code selected them.

Measured against a local build of main (b3e4b0d, same dev keys):
  usr.raw      211,357,696 -> 187,297,792  (-24.1 MB)
  disk UKI      79,671,296 ->  75,356,672  (-4.3 MB)
  netboot UKI   79,671,808 ->  75,357,184  (-4.3 MB)
  .linux        20,685,824 ->  16,372,736  (gzip -> zstd; cfg80211,
                mac80211 and the Bluetooth core are no longer built in)
Against v26.10.1215 (before projectbluefin#489): usr.raw 215,330,816, disk UKI
93,467,568.

Modules gone: 201 files / 23.9 MB (Wi-Fi 160 / 13.0 MB, amd 6.1 MB, xe
1.9 MB, nouveau 1.3 MB, radeon 0.9 MB, Bluetooth 27 / 0.6 MB, cec, five
DRM helpers only these drivers used, qmi_helpers). Added: libarc4.ko
(was built in via mac80211).
Kept: i915, simpledrm, virtio-gpu, hyperv_drm, vmwgfx, vboxvideo, gma500,
RFKILL (x86 platform drivers use it), DEBUG_INFO_BTF; sound, media, IIO and
input module counts unchanged. ast, mgag200 and bochs were not built
before this change and still are not.

Verified: 0001/0006/0007/0008/0009 git apply cleanly on the
freedesktop-sdk-26.08.2 tag; just validate; just export-image (kernel
rebuilt, expected-config check passed); just check-image vs 1215 and main;
just dogfood-check (Secure Boot diskless boot, failed=0).

Assisted-by: Claude Fable 5.1 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Patch 0009 stops building nouveau, so no driver holds an NVIDIA GPU when
the driver sysext merges. nvidia-load's eviction (`modprobe -r nouveau`
only when nouveau holds a GPU, sysfs unbind otherwise) is now a no-op and
stays as a guard for a kernel that does build nouveau; update the skill
and the helper and unit comments to say so. No behaviour change.

Assisted-by: Claude Fable 5.1 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ahmedadan after the PR has been reviewed.
You can assign the PR to them by writing /assign @ahmedadan in a comment when ready.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@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.

This change shrinks the server kernel by turning off drivers whose hardware can never work here (the image ships no firmware files) and by switching the kernel image to a tighter compression. The result is a smaller download and boot image. The kernel-config block does what the description says, and the trick for keeping the upstream "expected options" check honest is sound. One real problem: the compression switch is written for 64-bit Intel/AMD machines only, and it will break the kernel build on the 64-bit Arm target this project also declares. One shipped comment is now stale.

correctness

  • enable KERNEL_ZSTD is unguarded and will fail the aarch64 kernel build. patches/freedesktop-sdk/0009-linux-server-no-firmware-hw.patch:59-60 run remove KERNEL_GZIP; enable KERNEL_ZSTD for every arch. FSDK's enable() (files/linux/config-utils.sh:26-29) appends the name to expected-configs unconditionally, and linux.bst:81-88 fails the build on x86_64|aarch64 when an expected option is unset. arm64 has no in-kernel decompressor: arch/arm64/Kconfig has zero HAVE_KERNEL_* selects, so the "Kernel compression mode" choice (init/Kconfig:305-308) is not visible and olddefconfig leaves KERNEL_ZSTD unset. The block's own filter cannot save it — it only strips options that went set→unset (patch line 62), and KERNEL_ZSTD was never set in was_set. Net effect on aarch64: Missing KERNEL_ZSTD and a failed build — the exact class of break that issue #377 hit and that 0007 guards with case "$arch" in x86_64) (and that FSDK itself uses for DRM_XE/DRM_I915, fdsdk-config.sh:666-670). aarch64 is declared in project.conf:18-20 but not built in CI today (docs/skills/architecture-roadmap.md:43), so this PR's checks stay green. Fix: wrap lines 59-60 in the same case "$arch" in x86_64) … ;; esac as 0007, and extend tests/unit/test_kernel_no_firmware.py with the arch-guard assertion test_kernel_watchdog.py:183-194 already uses.

docs-currency

  • The PR says the nouveau "docs and comments" were updated, but files/nvidia/sysext/modprobe-nvidia.conf:1-3 (shipped in the sysext) still states "udev binds nouveau to the GPUs before that; nvidia-load.service evicts an already bound nouveau first", which is no longer true on the base kernel. tests/unit/test_nvidia_sysext.py:257-259 carries the same stale comment. Reword both like nvidia-load:6-13 did ("on a kernel that does build it…").

No findings from: security, intent-alignment, style.

Confidence: 3/5 (needs attention) — 1 medium finding; 2 perspectives requested changes

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor
45caadf

⚠️ Sentinel alert — maintainer review required

Hive flagged this PR (author @jeefy, head 45caadfc9477) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • remote_code_execution — adds a remote-fetch-and-execute, decoded payload, reverse shell or embedded credential (Adds curl|sh, eval of encoded payloads, reverse shells or embedded private keys)
    • tests/unit/test_kernel_no_firmware.py

Hive added the sentinel-alert label. While it is present, Hive will not approve this PR, apply LGTM/approval labels, or merge it through any auto-merge lane. Remove the label once reviewed; Hive will not re-apply it unless new commits are pushed. Tune paths and behaviors under sentinel in hive.yaml or the dashboard Security tab.

@jeefy jeefy added full-build Run the full image build and boot test on this pull request and removed sentinel-alert labels Oct 18, 2026
arm64 selects no HAVE_KERNEL_*, so `enable KERNEL_ZSTD` stays unset there
and FSDK's expected-configs check would fail the aarch64 kernel build with
"Missing KERNEL_ZSTD". Wrap the gzip->zstd switch in an x86_64 case, like
0007 does for the x86-only watchdogs, and test both arches.

Reword the modprobe-nvidia.conf comment and its test to say the base
kernel no longer builds nouveau.

Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor
da6862f

⚠️ Sentinel alert — maintainer review required

Hive flagged this PR (author @jeefy, head da6862fe1f65) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • remote_code_execution — adds a remote-fetch-and-execute, decoded payload, reverse shell or embedded credential (Adds curl|sh, eval of encoded payloads, reverse shells or embedded private keys)
    • tests/unit/test_kernel_no_firmware.py

Hive added the sentinel-alert label. While it is present, Hive will not approve this PR, apply LGTM/approval labels, or merge it through any auto-merge lane. Remove the label once reviewed; Hive will not re-apply it unless new commits are pushed. Tune paths and behaviors under sentinel in hive.yaml or the dashboard Security tab.

@jeefy
jeefy merged commit a6483b9 into projectbluefin:main Oct 18, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-build Run the full image build and boot test on this pull request sentinel-alert

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant