Skip to content

Switch the default kernel from Update > Kernel - #15966

Merged
dhh merged 13 commits into
quattrofrom
kernel-switch-menu
Oct 21, 2026
Merged

dhh merged 13 commits into
quattrofrom
kernel-switch-menu

Conversation

@dhh

@dhh dhh commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

When more than one kernel is installed, a new Update > Kernel menu sits under Channel. It lists the installed kernels, puts a ✓ next to the one Limine boots by default, and uses the wide layout Fonts uses so long names like linux-omarchy-bore-o3-exp fit. Picking one switches the default with a single pkexec prompt. Afterwards a 30s notification says "Now using " / "Reboot to use new default kernel", and clicking it reboots.

omarchy-kernel

  • omarchy-kernel / get: the default kernel, resolved from the effective BOOT_ORDER. Config files are read in limine-entry-tool's precedence, so /etc/default/limine wins over drop-ins. Each pattern is matched against the installed kernels' pkgbase. If a wildcard matches several kernels, only /boot/limine.conf (root-only) knows which comes first, so get reports the tie rather than guessing.

  • omarchy-kernel list: the installed kernels.

  • omarchy-kernel set <kernel>: refuses kernels that aren't installed, and refuses when Direct Boot is active, because the firmware skips Limine then. From the menu it escalates once through pkexec; in a terminal it uses sudo, per the privilege rules. As root it does three things:

    • writes the kernel first in BOOT_ORDER, keeping the rest of the effective order behind it (e.g. linux-t2 preferences)
    • rebuilds only that kernel with limine-mkinitcpio <kernel>, about 13s here instead of a full limine-update, which rewrites limine.conf in the new order
    • checks in limine-entry-tool --tree that the kernel is now the first entry

    If the rebuild or the check fails, it restores the previous BOOT_ORDER and rebuilds the previous default, so the config and the boot menu agree again.

The menu rows come from a new kernels provider in Menu.qml. The when guard only counts pkgbase files, so it adds no pacman or root calls to the guard batch.

Tests

test/shell.d/omarchy-kernel-test.sh has 13 cases. They cover get/list resolution (drop-in vs central precedence, globs, inline comments, wildcard ties), refusing kernels that aren't installed, the single-pkexec menu path and its notification, a cancelled prompt, and Direct Boot refusal for both halves. The root half runs in a user namespace and covers the BOOT_ORDER rewrite, idempotency, rebuilding a single kernel, and rollback after both a skipped build and a late failure.

The menu, menu-guard, guard-budget, bin-style and CLI suites pass. i18n-test.sh fails only on key parity for the other languages (the new English strings are untranslated until the sync runs), the same way quattro already fails on system.reboot-boot-menu.

I also ran a real omarchy-kernel set linux-omarchy on an x86 Limine machine through the pkexec path. It took one prompt, rebuilt only that kernel, passed the --tree check, and left BOOT_ORDER correct.

🤖 Generated with Claude Code

dhh and others added 9 commits October 19, 2026 21:59
When more than one kernel is installed, Update > Kernel lists them with
the boot default checked. Picking one runs omarchy-kernel set, which
authenticates once through pkexec, puts the kernel first in BOOT_ORDER in
/etc/default/limine, and rebuilds only that kernel's entry to reorder the
boot menu. omarchy-kernel and omarchy-kernel list report the default and
the installed kernels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rebuild that fails or never reaches the boot menu now puts the previous
BOOT_ORDER back, so neither omarchy-kernel get nor the next kernel update
acts on a rejected choice. A wildcard that ties several kernels no longer
picks one alphabetically: their limine.conf order decides and only root
can read it, so get reports the tie instead. Update > Kernel gets the
wide layout Fonts uses so long kernel names fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Direct Boot has the firmware load one UKI without Limine, so a reordered
boot menu would change nothing; say how to turn it off instead. A
BOOT_ORDER assignment with a trailing comment now counts, as it does for
limine-entry-tool.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Direct Boot check reads efibootmgr itself so sudo omarchy-kernel set
is refused like the menu path. A rebuild that reorders the boot menu and
then fails in a post hook now rebuilds the previous default under the
restored order, so the menu and BOOT_ORDER agree again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable defect was established.

Summary

Adds Update > Kernel and omarchy-kernel to choose which installed kernel Limine boots first.

  • The Update menu lets people choose Limine’s default kernel.

Previous threads were rechecked without posting duplicates. dhh explicitly accepted leaving the checkmark off for hand-edited wildcard-first orders because shipped defaults and set use exact kernel names. None of the supplied root threads has a comment number.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Choose an installed kernel] --> B{Direct Boot active?}
  B -->|Yes| C[Refuse the switch]
  B -->|No| D[Ask for permission]
  D --> E[Lock kernel switches]
  E --> F[Save the current order and menu leader]
  F --> G[Write the chosen kernel first]
  G --> H[Rebuild that kernel]
  H --> I{Chosen kernel leads the menu?}
  I -->|Yes| J[Notify the user to reboot]
  I -->|No or build fails| K[Restore configuration and attempt to restore the menu]
Loading

Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/qua..." · Reviewed by Greptile

Comment thread bin/omarchy-kernel Resolved
Comment thread bin/omarchy-kernel Resolved
Comment thread bin/omarchy-kernel Resolved
Comment thread bin/omarchy-kernel Resolved
dhh and others added 3 commits October 19, 2026 22:32
…eader

Overlapping switches from the detached menu action could let one that
failed restore its backup over another that had succeeded, so a switch
now holds a lock from reading the old state through rollback. The new
BOOT_ORDER is staged beside /etc/default/limine and renamed over it, so a
failed write cannot delete the saved order. Rollback rebuilds the kernel
that led the boot menu before the switch, which root reads from the menu
itself, so a wildcard tie no longer leaves nothing to restore. The kernel
command gets its GROUP_DESCRIPTIONS entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge the BOOT_ORDER reader into one function, write the config in place
inside the rollback instead of staging a separate file, and have get name
a kernel only when the first match is an exact name rather than counting
wildcard ties.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-kernel Resolved
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