Skip to content

Skip kernel migration without Limine tooling - #14188

Merged
ryanrhughes merged 1 commit into
omacom:quattrofrom
manuaudio:claude/fix-kernel-migration-non-limine
Oct 27, 2026
Merged

ryanrhughes merged 1 commit into
omacom:quattrofrom
manuaudio:claude/fix-kernel-migration-non-limine

Conversation

@manuaudio

@manuaudio manuaudio commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Migration 1789325478 assumes limine-mkinitcpio is available. Machines upgraded from older Omarchy releases can still boot with GRUB or systemd-boot, so the migration installs linux-omarchy, edits Limine configuration, and then stops at a missing command. Because it remains pending, it also blocks later migrations.

Fix

I now check for limine-mkinitcpio before the migration changes packages or boot configuration. If the command is absent, the migration explains the skip and leaves the existing kernel and boot setup untouched.

I removed the later boot-config detection added during review. It had grown into a second implementation of Limine's ESP and configuration discovery, including mount parsing. The command-presence boundary is smaller and matches the concrete failure this PR reproduces. It also avoids misclassifying Limine installs with a custom ESP_PATH.

Verification

The regression stubs the command check and verifies that the migration makes no package, config, marker, or reboot-state changes when the tooling is absent. On the unmodified base, it failed because the migration performed the full kernel switch. After rebasing onto current quattro, I kept upstream's deletion of this shipped migration test, restored the test temporarily, and confirmed all 20 cases still pass.

  • Historical focused migration test: 20/20 pass
  • bash -n migrations/1789325478.sh
  • git diff --check
  • Fresh Codex review: no actionable regressions

A machine that still has limine-mkinitcpio installed while booting another loader is not identified by this guard.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge within its stated command-presence boundary.

Summary

Adds an early skip to 1789325478.sh when limine-mkinitcpio is unavailable.

  • The kernel migration skips machines without Limine tooling.

Reviews (14) · Last reviewed commit: "Skip kernel migration without Limine too..." · Reviewed by Greptile

Comment thread migrations/1789325478.sh Resolved
Comment thread migrations/1789325478.sh Resolved
Comment thread migrations/1789325478.sh Resolved
@manuaudio
manuaudio force-pushed the claude/fix-kernel-migration-non-limine branch from 9e53af7 to ef451f3 Compare October 4, 2026 02:44
@manuaudio

Copy link
Copy Markdown
Contributor Author

Addressed both new findings in ef451f3 after rebasing onto current quattro:

  • Removed sudo -v; the migration now performs the boot-config classification inside the privileged command, so passwordless command access is not blocked by verifypw=all.
  • A failed privileged command now exits nonzero instead of being interpreted as a missing /boot/limine.conf.

The focused regression test failed first on the passwordless-sudo case, then passed with cases for passwordless command access and denied privileged checks. Bash syntax checks and git diff --check also pass.

@manuaudio
manuaudio force-pushed the claude/fix-kernel-migration-non-limine branch from ef451f3 to db8162a Compare October 4, 2026 18:14
@jandrusk

jandrusk commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for this, skipping non-Limine machines is the right call. One thing worries me before it lands: /boot/limine.conf is hardcoded as the signal.

Limine installs with the ESP somewhere else (e.g. ESP_PATH=/efi in /etc/default/limine) keep their config at $ESP_PATH/limine.conf. On those machines this check prints "does not boot with Limine" and exits 0. omarchy-migrate then writes the per-user marker, so the kernel switch is skipped for good, even though these users got linux-omarchy before this change.

omarchy-provision-owner already reads the ESP from /etc/default/limine. Could the migration do the same?

limine_esp=$(sed -n 's/^ESP_PATH=["'\'']\?\([^"'\'']*\).*/\1/p' "$limine_conf" 2>/dev/null | tail -1)
limine_boot_conf="${OMARCHY_KERNEL_LIMINE_BOOT_CONF:-${limine_esp:-/boot}/limine.conf}"

A test case with ESP_PATH pointing at a scratch ESP would cover it. Also, heads up: #12691 edits the same migration, so whichever lands second will need a rebase.

@manuaudio
manuaudio force-pushed the claude/fix-kernel-migration-non-limine branch from db8162a to 5c0aba3 Compare October 6, 2026 14:45
@manuaudio

Copy link
Copy Markdown
Contributor Author

jandrusk caught that the hardcoded /boot/limine.conf check would permanently skip Limine installs whose ESP is mounted elsewhere. I corrected it in 5c0aba3: the migration now resolves the boot config from ESP_PATH in the main Limine config, while preserving /boot as the default and the explicit test override. The focused custom-ESP regression failed first at the configured ESP's Limine boot config is checked; all 24 kernel-migration cases now pass, along with both Bash syntax checks and git diff --check.

Comment thread migrations/1789325478.sh Resolved
Comment thread migrations/1789325478.sh Resolved
Comment thread migrations/1789325478.sh Resolved
@manuaudio

Copy link
Copy Markdown
Contributor Author

Greptile correctly flagged that an unmounted FAT32 fstab entry does not identify a Limine machine. Commit 3147c5a removes that inference: automatic discovery now follows only mounted FAT32 candidates, matching limine-entry-tool, while a configured ESP_PATH still stays pending when its expected FAT32 mount is unavailable. The focused regression first failed with an unrelated unmounted FAT32 candidate is skipped; all kernel-migration checks, both Bash syntax checks, git diff --check, and the fresh Codex review now pass.

Comment thread migrations/1789325478.sh Resolved
Comment thread migrations/1789325478.sh Resolved
@manuaudio

Copy link
Copy Markdown
Contributor Author

Greptile correctly flagged that a matching systemd mount unit did not prove the filesystem was an ESP. Commit 05b4e0d now treats a systemd-managed path as an unavailable ESP only when the mount unit declares Type=vfat; an unrelated Type=ext4 unit is skipped as non-Limine. The focused regression failed first at an unrelated systemd mount is skipped; all 33 kernel-migration checks now pass, along with both Bash syntax checks, git diff --check, the added-line security scan, and a fresh Codex review with no actionable findings.

Comment thread migrations/1789325478.sh Resolved
Comment thread migrations/1789325478.sh Resolved
@manuaudio

Copy link
Copy Markdown
Contributor Author

The two new Greptile findings are corrected in f6c84d7. The migration now reads systemd’s effective mount configuration, so unit-directory precedence and drop-ins are honored. Type=auto or an omitted type is resolved from the unit’s backing device; auto-typed fstab entries use the same device check. I also fixed quoted ESP_PATH values with trailing whitespace after the fresh Codex review caught that boundary. The precedence, auto-typed unit, and auto-typed fstab regressions each failed first on the prior code. The focused migration suite, both Bash syntax checks, git diff --check, the added-line security scan, and the final Codex review now pass with no blocking findings.

Comment thread migrations/1789325478.sh Resolved
@manuaudio

Copy link
Copy Markdown
Contributor Author

Greptile’s quoted-hash finding is corrected in bfdc3a4. ESP_PATH parsing now identifies a quoted value before looking for an inline comment, so a path such as /mnt/esp #1 remains intact while trailing comments on quoted or unquoted assignments still work. The focused hash-path regression failed first at a quoted ESP_PATH preserves its hash character; the migration suite, both Bash syntax checks, git diff --check, and the fresh Codex review now pass with no blocking findings.

Comment thread migrations/1789325478.sh Resolved
@manuaudio

manuaudio commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Greptile’s single-quote finding is corrected in dbf02a1. The single-quoted parser now stops at the first closing quote before the optional comment, so ESP_PATH='/efi' # formerly 'old' resolves to /efi rather than consuming the comment. The regression failed first at a trailing quoted comment does not change a single-quoted ESP_PATH; the focused migration suite, both Bash syntax checks, git diff --check, and the final Codex review pass with no blocking findings.

@manuaudio manuaudio changed the title Skip the Omarchy kernel migration on machines that do not boot with Limine Skip kernel migration without Limine tooling Oct 6, 2026
@manuaudio
manuaudio force-pushed the claude/fix-kernel-migration-non-limine branch from dbf02a1 to 0d571cc Compare October 6, 2026 19:11
@manuaudio

Copy link
Copy Markdown
Contributor Author

I over-expanded this after the ESP_PATH review. I replaced the branch with 0d571cc, which keeps only the command-presence guard and its focused regression. This removes the duplicate Limine config and mount discovery, avoids the custom-ESP false skip, and limits the claim to the reproduced missing-tooling failure. The regression failed on current quattro before the guard; all 20 focused migration cases, both Bash syntax checks, git diff --check, the added-line security scan, and a fresh Codex review pass.

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks, re-checked: cutting it back to just the command-presence guard is the right call. It avoids the custom-ESP false skip entirely and is much easier to review. LGTM.

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for paring this back. Gating on limine-mkinitcpio avoids the custom-ESP false skip entirely, since Limine installs with the ESP at /efi still have the tooling and get migrated. LGTM.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 0d571cc by Claude Opus 5.5. The fix holds up, and I found nothing to change.

Reproduced on a worker built from the Omarchy ISO. I ran migration 1789325478 with limine-mkinitcpio actually missing from PATH, rather than with omarchy-cmd-present stubbed. On quattro it exits 127 at sudo limine-mkinitcpio, but only after it has already installed linux-omarchy and rewritten BOOT_ORDER in /etc/default/limine. On this head it prints the skip message, exits 0 and changes nothing. With the five-line guard taken back out it fails the same way quattro does.

Proportionate. The guard is the same omarchy-cmd-present limine-mkinitcpio check that migrations 1786482992 and 1786605598 already use, and it comes after the T2 and architecture exits. Limine installs with the ESP mounted somewhere other than /boot still have the tooling, so they still migrate. As the description says, a machine that has limine-mkinitcpio installed but boots another loader gets past the guard. That is the same as on quattro today.

Tests: ./test/cli passes on the worker, and so do all 20 cases in test/shell.d/omarchy-kernel-migration-test.sh. The full test/shell run has 7 failing files (ascii, branding-about-animation, network-captive-portal, network-owe-transition, passwordless-grant-lifecycle, runtime-smoke, screenshot-sanity). None of them touch this migration, and all 7 fail the same way on this branch's merge-base with quattro. This branch is 240 commits behind quattro, which has not changed this migration since.

No second opinion ran. The configured reviewer, Codex Medium, responds, but omabot's daily review limit was used up. Classifying this item needs a second model to agree, so it is unsettled for now and has no labels yet. It will be reviewed again once the reviewer is available.

Related: #12691 edits the same migration to exempt Intel Macs. It is not a competing fix, but whichever of the two lands second will need a small rebase. #14908 is a separate failure in this migration (linux-omarchy became a meta package), and this pull request does not change it.

Nothing is waiting on the author. Next is a second-opinion review, then the maintainer's decision.

@manuaudio

Copy link
Copy Markdown
Contributor Author

Thanks @jandrusk — I agree with keeping this to the command-presence guard. I rechecked the current head: the focused migration proof and checks pass, and the branch is clean.

@manuaudio
manuaudio force-pushed the claude/fix-kernel-migration-non-limine branch from 0d571cc to cb13c67 Compare October 24, 2026 03:52
@ryanrhughes ryanrhughes added this to the 4.5 milestone Oct 26, 2026
@ryanrhughes
ryanrhughes merged commit 39d5665 into omacom:quattro Oct 27, 2026
2 checks passed
omarchybot added a commit to nipunhsud/omarchy that referenced this pull request Nov 1, 2026
quattro removed the migration tests (omacom#16302), including test/shell.d/omarchy-kernel-migration-test.sh, which this branch extended with its Apple cases. Resolve the conflict by taking the deletion, per the house rule that migrations get no suite test; the migration change merges cleanly beside the Limine tooling skip from omacom#14188.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

4 participants