Repository navigation
Pin root= before the packages that can drop it - #6951
Conversation
limine-entry-tool falls back to /proc/cmdline for root= only while nothing appends to KERNEL_CMDLINE. Installing omarchy-settings lands a drop-in that appends with +=, switching that fallback off, and a kernel bump in the same transaction then bakes a UKI with no root= at all. preserve_kernel_cmdline_root repaired that afterwards, so a completed upgrade booted — but the machine was unbootable for the seconds in between, and an upgrade interrupted there left it in an emergency shell. Pinning cannot wait until after the packages land, and the old guard could not be moved earlier as it was: it asked the tool for its effective cmdline, which still resolves root= through the fallback right up until the drop-in arrives, so it reported healthy on exactly the machines about to break. Ask the config layers whether root= is stated explicitly instead, for the default profile alone, and pin before the package transaction. Verification stays after it, since that is what rebuilds the UKIs. The pin no longer gates on limine-mkinitcpio being present, since it now runs before the transaction that can install it, and a machine still missing it is exactly one that needs pinning first. Verified in a VM upgrading a 3.8.0 install, sampling the UKI every 2s across the upgrade: a legacy install without the pin lost root= for ~10s, and booting that state landed in "Failed to mount '' on real root". With this change the same upgrade never loses it, and an install that already pins root= is untouched. Closes #6894 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Pins Limine’s root= parameters before package installation to prevent transiently unbootable UKIs.
Changes:
- Detects explicit
root=configuration. - Moves preservation before package installation.
- Verifies rebuilt UKIs afterward.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-upgrade-to-quattro |
Reorders and separates kernel command-line preservation and verification. |
test/shell.d/upgrade-to-quattro-test.sh |
Updates ordering and guard assertions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Reviewed this against Three things. 1. The Cheapest fix: call 2. Two regex cases in
Someone who "commented out" a pin by renaming rather than prefixing And
3. Scope, since #6894 sits in a cluster. This fixes the cmdline half only. #6876's Also flagging that #6758 edits this same function in an incompatible direction: it keeps |
…pin after the transaction The pin check returned on any line that mentioned root= under KERNEL_CMDLINE[default]. limine-entry-tool merges its layers in order, /usr/share drop-ins, /etc/limine-entry-tool.conf, /etc drop-ins, then /etc/default/limine, where = replaces and += appends, so a later layer's = could remove a pin the check still counted, and a quote before root= let systemd.setenv="root=..." read as one. Both skip the pin, which is the direction that bricks the next boot. The check now merges the layers the same way, strips only the outer double quotes the tool strips, drops quoted values the kernel does not split, and looks for root= as a parameter of its own. It was checked against limine-entry-tool --get-cmdline on a worker for every fixture in the test. Installing limine-mkinitcpio-hook runs limine-install, so a machine with no /boot/limine.conf when the pin runs ahead of the transaction can have one after it, and verification only warned about the UKI it found without root=. Verification now runs the pin for any machine the first call skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Re-reviewed on a worker built from the Omarchy ISO, and pushed 2a8adba on top of your commit to fix the two defects the earlier review raised. Nothing is left for you to do; it is waiting on the maintainer. Reproduction. The worker's limine config was put in the legacy state: the What 2a8adba changes
Tests. Second opinion. Codex at medium effort reviewed four rounds. It found the superseded-assignment case, the missing Still open elsewhere. This fixes the |
One upstream commit (omacom#6951) changes bin/omarchy-upgrade-to-quattro and its test, both outside the verification scope; no menu or lock file changed. Research note review/upstream-393a43d4-research-delta.md; upstream_refresh_v1 steps 1-13 confirmed, coverage and the campaign stamp follow the audit.
omacom#6951 moved the root= pin ahead of the package transaction and replaced the limine-entry-tool guard with kernel_cmdline_root_pinned, which touched the lines this branch adds beside. Both sides are kept: normalize_encrypt_hook_param sits before kernel_cmdline_root_pinned, and the PR's conversion tests sit before omacom#6951's pin tests. The PR's test for the old --get-cmdline guard is dropped, since omacom#6951 removed that guard and asserts it stays gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reproduced #6894 in a VM, upgrading a real 3.8.0 install from the ISO.
What is actually happening
limine-entry-toolfalls back to/proc/cmdlineforroot=only while nothing appends toKERNEL_CMDLINE. Installingomarchy-settingslandsomarchy-defaults.conf, which appends with+=and switches that fallback off. A kernel bump in the same transaction then fires the limine hook and bakes a UKI whose cmdline is only:preserve_kernel_cmdline_rootrepaired that afterwards, so a completed upgrade did boot. The problem is the gap in between.Measured
Sampling
/boot/limine.confand every UKI's embedded cmdline every 2s across the whole upgrade:/etc/default/liminealready pinsroot=)root=never dropped, even though the kernel was bumped 7.0.3 → 7.1.8 and the UKI was rebuilt mid-upgrade. Booted fine.KERNEL_CMDLINE(pre-dates the ISO pin,root=resolved via the fallback)root=absent from the UKI for ~10 seconds, then repaired. Booted fine.ERROR: Failed to mount '' on real root→ emergency shellSo this is not every upgrade, and not the multi-minute window it might look like — but on installs that pre-date the ISO pinning
root=, there is a real interval where the machine will not boot, and anything that interrupts the upgrade there strands it exactly as reported.The fix
Pinning cannot wait until after the packages land. The old guard could not simply be moved earlier either: it asked the tool for its effective cmdline, which still resolves
root=through the fallback right up until the drop-in arrives — so it reports healthy on precisely the machines that are about to break, and would have made an early call a no-op.So the guard now asks the config layers whether
root=is stated explicitly, for thedefaultprofile alone, and the pin runs before the package transaction. Verification stays after it, since that is what rebuilds the UKIs. The pin also no longer gates onlimine-mkinitcpiobeing installed, because it now runs before the transaction that can install it — a machine still missing it is exactly one that needs pinning first.Verified
Same VM, same instrumentation, after the change:
root=across the entire upgrade, with the same 7.0.3 → 7.1.8 kernel bump. Boots./etc/default/limineunchanged. Boots.Reviewed with codex at xhigh; its findings on the guard (profile-specific matching, unquoted assignments, the extra config layer, root-side globbing, and the
limine-mkinitcpiogate) are folded in. The ordering assertion inupgrade-to-quattro-test.shencoded the old sequence and now asserts the new invariant in both directions.Closes #6894
— 🤖 Claude, posting on behalf of @dhh