Skip to content

Install DKMS headers for the kernel that actually boots - #12249

Closed
Chessing234 wants to merge 8 commits into
omacom:quattrofrom
Chessing234:fold/dkms-headers-ptl-order
Closed

Chessing234 wants to merge 8 commits into
omacom:quattrofrom
Chessing234:fold/dkms-headers-ptl-order

Conversation

@Chessing234

@Chessing234 Chessing234 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

@llstrk

llstrk commented Sep 25, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: On the current quattro base, the new helper does not recognize the default linux-omarchy kernel, so the five edited installers request headers for a kernel that is not booted. The base also documents that the installer, not individual DKMS scripts, supplies matching headers. Reconsidering whether per-installer headers are still wanted at this base is suggested.

Verified: omarchy-pkg-linux-headers follows its own list and prints only real package names. It reads installed packages rather than uname, so the live ISO kernel inside the install chroot does not mislead it. On T2 Macs it selects linux-t2-headers, which is already installed, so the call sites add nothing there. Users who installed linux-zen, linux-lts or linux-hardened themselves without headers would now get them. test/shell.d/pkg-linux-headers-test.sh passes on the head and on the head merged into the current quattro tip, fails when the helper is absent, and is picked up by test/shell.

Default linux-omarchy kernel is not in the helper's list

The flavor list is linux-ptl, linux-t2, linux-zen, linux-lts, linux-hardened, linux. On a default non-T2 system (kernel linux-omarchy, selected by the ISO and by migrations/1789325478.sh), the helper therefore prints linux-headers. linux-omarchy-headers provides only uppercase LINUX-HEADERS, so omarchy-pkg-add treats linux-headers as missing and installs it:

Context (default non-T2 system with NVIDIA, BCM4360/4331, Tuxedo/Slimbook or YT6801 hardware, or running the Xbox installer) Base Head
Fresh ISO install (hardware leaves run against the ISO's single offline repository) driver package only driver plus linux-t2-headers, via its lowercase linux-headers provide
Installed system (Xbox menu action, hardware setup rerun) driver package only driver plus stock core/linux-headers
Headers for the booted linux-omarchy kernel already installed by the ISO / migration 1789444024 unchanged

omarchy-pkg-add's own check (pacman -Q linux-headers) is satisfied by the same linux-t2-headers provide, so the substitution is not reported. After installation, the [arch-mact2] repository is configured only on T2 Macs, so that package is left without a repository elsewhere. Pre-T2 MacBooks with BCM4360/4331 also boot linux-omarchy and would receive T2 headers.

Impact: No benefit on the default configuration. An unrelated full headers package is installed for a kernel that is not running, which contradicts the PR title. The new test has no linux-omarchy case, and its "no kernel package still names linux-headers" assertion encodes this fallback.

Suggested change: If call-site headers are kept, include linux-omarchy (and linux-omarchy-* variants) and avoid falling back to stock linux-headers when linux is not installed. One option is deriving <pkgbase>-headers from each /usr/lib/modules/*/pkgbase, which covers every installed kernel and works in the chroot. Add a linux-omarchy case to the test.

Per-installer headers reverse the base's documented header contract

At the base, agents/skills/install-scripts.md states: "The base install supplies matching kernel headers before hardware setup. DKMS installers should install their driver packages and assume the headers exist." Commit 24417bf ("Treat matching kernel headers as a base system guarantee", an ancestor of this PR's base) removed an earlier omarchy-pkg-add-kernel-headers helper and its per-installer calls for this reason. That removed helper preferred linux-t2-headers or linux-omarchy-headers over a leftover stock kernel. The omarchy-iso installer now installs <kernel>-headers for the selected kernel before hardware setup.

The PR description and commit messages describe pacman -Qqs '^linux…' | head -1 and hardcoded linux-headers in these installers. Those existed at #10797's older base but are absent at this base, where the call sites install no headers at all. The new test also enforces the opposite of the documented rule for these five files.

Impact: The PR re-adds a mechanism the base removed on purpose, with a selector that regresses the precedence the removed helper had.

Suggested change: Confirm with maintainers whether per-installer headers are still wanted. If not, closing in favour of the existing base guarantee is simpler. If so, the documented rule in install-scripts.md would need updating along with the selector fix above.

First installed flavor is not necessarily the kernel that boots

linux-ptl is checked first, but nothing at the base installs it any more (the PR description also notes the Panther Lake path is gone). A Panther Lake machine migrated by 1789325478, which keeps the old kernel and boots linux-omarchy first, gets linux-ptl-headers. The order among linux-zen, linux-lts and linux-hardened is fixed, not tied to the booted entry, and unlisted flavors (linux-omarchy-bore, linux-rt, custom kernels) fall back to stock headers. The DKMS hook builds for every installed kernel that has headers.

Impact: Headers can be selected for a kernel other than the booted one, and unlisted flavors fall back to stock headers.

Suggested change: Target all installed kernels rather than one chosen flavor, for example with the pkgbase approach in the first finding.

NVIDIA headers are installed before the supported-GPU check

install/hardware/nvidia.sh now installs headers before the omarchy-hw-nvidia-gsp / omarchy-hw-nvidia-without-gsp checks. On a GPU that matches neither, headers are installed and the script then prints "No compatible driver".

Impact: A headers transaction runs on systems where no NVIDIA driver will be installed.

Suggested change: Move the header call inside the supported-driver branches.


Review information

Test scope: Source review of head e1a95dfc, base 9c5482c5 and the current quattro tip, plus omarchy-iso quattro installer sources, omarchy-pkgs and Arch packaging metadata, and pacman source. Run in an isolated sandbox: the PR's test on the head and on the head merged into the tip; real pacman 7.1.0 in print-only mode against private copies of current public sync databases (offline-mirror subset and online non-T2 repositories); the real helper and installer scripts against a pacman model built from repository metadata. Offline mirror contents were derived from the ISO builder's package lists, not from a built ISO. Not tested: ISO build or install, VMs, real NVIDIA/Broadcom/Tuxedo/YT6801/T2 hardware, or DKMS hook output with headers installed without their kernel.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@Chessing234

Copy link
Copy Markdown
Contributor Author

closing — tip already installs matching headers before hardware setup, and this helper misses linux-omarchy anyway.

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.

2 participants