Skip to content

Hold the reboot back when a kernel lacks a required driver - #15905

Open
gjinali wants to merge 2 commits into
omacom:quattrofrom
gjinali:feat/update-kernel-module-gate
Open

gjinali wants to merge 2 commits into
omacom:quattrofrom
gjinali:feat/update-kernel-module-gate

Conversation

@gjinali

@gjinali gjinali commented Oct 18, 2026

Copy link
Copy Markdown

Summary

Pacman exits successfully even when a DKMS PostTransaction hook fails. An update can therefore install a kernel that is missing a driver its hardware needs, and still offer the reboot. This adds a driver check to the gate that already holds the reboot back after the boot check:

 omarchy update
   …
   omarchy-update-aur-pkgs
   omarchy-update-boot                      || boot_verified=0
+  omarchy-update-verify-kernel-modules     || boot_verified=0
   omarchy-update-stay-awake stop
   if boot_verified
     omarchy-update-restart --reboot-only
   else
-    "…its boot files did not pass verification…"; exit 1
+    "…the updated system did not pass verification…"; exit 1

omarchy-update-verify-kernel-modules is hidden, read-only and runs as the user:

verifiers = [verify-snd-hda-macbookpro, verify-facetimehd] that exist under /usr/lib/omarchy/
if none: exit 0                                   # no pacman query at all
for kernel in [linux-omarchy, linux] if installed:
  targets += modules.order paths pacman owns for it
for verifier: verifier --modules-root /usr/lib/modules < targets
any failure → name the missing driver and kernel, exit 1
  • Which kernels: the stock kernel (linux-omarchy) and the Arch linux kept as its fallback are checked. Other kernels (lts, zen, t2) are alternatives the user manages. Module directories preserved from earlier boots are not checked.
  • Where the verifiers come from: they are shipped by compatibility packages. The list is fixed in the command, so files on disk don't decide what runs. The only verifiers today come from Add MacBookPro13,1 camera and audio packages omarchy-pkgs#182, the MacBookPro13,1 camera and audio packages. That PR's verifiers already accept this interface and both kernels.
  • What happens on failure: the update fails exactly as a failed boot check does. The remaining steps finish and Stay Awake is released, but no reboot is offered, so the previous kernel stays booted. Nothing is rolled back.

This is the update gate split out of #7732, as the review there suggested. It is rebuilt on current quattro's boot-check gate, replacing the earlier separate step and the direct omarchy-update-restart refusal.

Evidence

  • Before: on 2026-09-09, a MacBookPro13,1 update moved from Linux 7.1.9 to 7.2.3. Both DKMS builds failed and the post-DKMS verifiers printed ERROR: Missing facetimehd for stock kernel 7.2.3-arch1-3, yet pacman returned 0 and the update offered the reboot. After the reboot, the camera had no driver and the speakers fell back to the stock CS8409 driver.
  • After:
    • In test/shell.d/update-sequence-test.sh, the module check fails while every other step succeeds. The update exits 1, says "The update is not finished", releases Stay Awake, and does not offer the reboot. On unmodified quattro, the same suite fails its step-order assertion because nothing runs the check.
    • test/shell.d/update-kernel-modules-test.sh covers seven cases:
      • drivers missing on the stock and fallback kernels are both named;
      • one missing driver on one kernel fails the check;
      • complete kernels pass, and a preserved directory is not checked;
      • an uninstalled fallback kernel is skipped;
      • an alternative-kernel system passes without running a verifier;
      • an unreadable package database fails the check;
      • a machine without compatibility packages never queries pacman.
    • Also passing: ./test/cli, update-boot-verify, update-restart-phases and update-sequence.
    • On the reference MacBookPro13,1, with linux-omarchy 7.2.8-9 and linux 7.2.11 installed and the packages from Add MacBookPro13,1 camera and audio packages omarchy-pkgs#182, the command exits 0.
    • update-restart-kernel-test.sh fails on this host on unmodified quattro as well. It reads the host's kernel state, and this change doesn't touch it.

Merge Danger

Door: two-way

Reverting the commit removes the step. It writes nothing, and no other component consumes its exit status apart from the update's existing boot_verified gate.

Blast Radius: narrow

On machines without one of the listed compatibility packages, it is a no-op that runs no pacman query. On machines with them, a driver that genuinely failed to build now fails the update and withholds the reboot prompt. A faulty verifier would cause the same outcome: the update reports unfinished and the user is told to repair the drivers, while the system stays on its current kernel. The update's failure message now reads "the updated system" rather than "its boot files", because it covers both checks.

🤖 Generated with Claude Code

Pacman succeeds even when a DKMS hook fails, so an update can install a
kernel without a driver its hardware requires. After the boot check, run
the verifiers that installed compatibility packages ship against the
stock and fallback kernels, and fail the update without the reboot
prompt when one reports a missing module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issues were found.

Summary

The PR adds a required-driver check before the update offers a reboot.

  • Omarchy updates check required drivers before offering a reboot.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Finish package updates] --> B[Check boot files]
  B --> C[Check required drivers]
  C --> D[Release Stay Awake]
  D --> E{Both checks passed?}
  E -->|Yes| F[Offer reboot]
  E -->|No| G[Report unfinished update and exit 1]
Loading

Reviews (2) · Last reviewed commit: "Fail the module check when a kernel's fi..." · Reviewed by Greptile

gjinali added a commit to gjinali/omarchy that referenced this pull request Oct 18, 2026
The gate now lives in omacom#15905, rebuilt on quattro's boot
check and extended to the linux-omarchy kernel.

This reverts commit e0ad4dc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed pacman -Qlq inside process substitution went unnoticed, and an
installed kernel without modules.order contributed no targets, so either
let the check pass without verifying that kernel. Use the documented
test header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Read at fcf097a2: the diff, the update pipeline on quattro it hooks into, and the verifier interface in omacom/omarchy-pkgs#182 that the new command calls. Nothing was run yet, because the review stops at classification for now.

The classification is unsettled. Claude Opus 5.5 read this as an enhancement: no package on quattro or in Omarchy's repositories ships verify-snd-hda-macbookpro or verify-facetimehd today, since both arrive with omacom/omarchy-pkgs#182, which is still open. Until that lands, omarchy-update-verify-kernel-modules exits 0 on every machine without querying pacman, so this adds a new gate for packages to come rather than changing behaviour anyone can hit on quattro now. Codex Medium, asked separately, classified it as a bug, reading the underlying problem as real: pacman returns success when a DKMS PostTransaction hook fails, so the update can still offer a reboot. Neither class label has been added, and it was not verified on a worker.

This waits on the maintainer to decide what it is, and whether the update pipeline should carry a fixed list of one model's compatibility verifiers ahead of the packages that provide them.

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