Skip to content

migrations: authorize the quiet boot menu with a sudo command, not sudo -v - #15824

Closed
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:limine-migration-sudo-true
Closed

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:limine-migration-sudo-true

Conversation

@AnPod

@AnPod AnPod commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #15728

Problem

On a machine with passwordless sudo (NOPASSWD: ALL next to the stock passworded rule), omarchy update -y aborts during migration 1791898365 ("Speed up the boot menu and keep it quiet until a key is pressed"). The migration authorizes with sudo -v, and under sudo's default verifypw=all, -v demands a password whenever any of the user's rules needs one — even though every command runs passwordless. Migrations run under bash -euo pipefail, so the failed sudo -v kills the update after packages were already upgraded, leaving the box half-updated.

Fix

Authorize by running a command (sudo true) instead of sudo -v, exactly as bin/omarchy-update already does (authorize_update, with the same verifypw=all rationale in its comment) and as omarchy-update-stay-awake was fixed (#9467). A denied prompt still fails the migration and leaves it pending, preserving the original intent of that code path.

Test

New test/shell.d/limine-quiet-migration-sudo-test.sh (auto-discovered), using a stub sudo that models the reported machine: -v fails with "a password is required" while real commands execute.

  • With the fix stashed, the migration dies on the failed sudo -v and the test fails (red).
  • With the fix, the migration authorizes by command, checks the unreadable menu through sudo, and exits 0 leaving it pending; a readable menu still gets timeout: 1 and quiet: yes (green).

Related existing tests pass: limine-defaults-test.sh, console-no-ansi-query-migration-test.sh, factory-reset-limine-hashes-test.sh, dgx-spark-boot-test.sh.

…do -v

Under the default verifypw=all, sudo -v asks for a password even when
every command runs passwordless, so an unattended omarchy update stopped
in the middle of its migrations on a NOPASSWD machine. Authorize by
running a command instead, the way omarchy-update already does.

Fixes omacom#15728
@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; the previous test failure is fixed and no new actionable issues were found.

Summary

The migration now uses sudo true instead of sudo -v, so passwordless sudo can authorize the command without an unwanted password prompt.

  • The Limine migration authorizes with a command before checking unreadable menus.

Reviews (2) · Last reviewed commit: "test: deny sudo true in the quiet boot s..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down. This makes the same change as #15729, opened a day earlier for the same issue (#15728): both replace sudo -v with sudo true in migrations/1791898365.sh, with the same intent that a denied prompt still leaves the migration pending. When two fixes are this close, the older one goes ahead, so #15729 is the one being taken forward.

What was checked, on a disposable Omarchy worker with sudo set up like the report (NOPASSWD: ALL beside a passworded rule, so sudo -n -v fails and sudo -n true succeeds): on quattro the migration aborts with "a password is required" against a menu only root can read, and with this change it applies timeout: 1 and quiet: yes. So the fix itself is right. The full ./test/cli suite passed.

One defect here that #15729 does not have: this pull request leaves the existing test/shell.d/limine-quiet-boot-migration-test.sh failing (6 passed, 1 failed: "a denied sudo prompt was reported as a successful migration"). That test's sudo stub only denied sudo -v, so once the migration runs sudo true its denied-prompt case denies nothing. #15729 updates that stub, and its passwordless case covers what the new test file here adds. The new file also fails when run as root, as the Greptile comment says: chmod 000 hides nothing from root.

This was reviewed by Claude Opus 5.5 alone. The second opinion (Codex Medium) did not run, because omabot's daily review quota was used up; the reviewer itself answered a ping. Without it the classification is unsettled, so this gets no labels for now and has not been closed. It waits on the maintainer to choose between this and #15729.

@omarchybot omarchybot added the bug Something isn't working label Oct 21, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for the follow-up commit: the existing limine-quiet-boot-migration-test.sh stub now denies sudo true, which fixes the failing denied-prompt case noted earlier, and the root skip in the new test file addresses the Greptile comment.

The fix itself is the same change as #15729, opened a day earlier for the same issue (#15728) against quattro: both replace sudo -v with sudo true in migrations/1791898365.sh before checking an unreadable menu through sudo, so a passwordless machine authorizes and a denied prompt still leaves the migration pending. #15729's updated stub makes sudo -v fail on every run, so its suite already exercises the passwordless case the new test file here adds. Since the two are the same fix and neither misses a case the other handles, the older one goes ahead, and this one is being closed as a duplicate of #15729. If that is wrong, it can be reopened.

Checked by Claude Opus 5.5 and, as an independent second opinion, Codex Medium, which agreed separately that this is a bug fix and was asked separately whether this duplicates #15729. Nothing was run for this head: the change to the migration is the same one already verified on a disposable Omarchy worker for #15729.

@omarchybot omarchybot added the duplicate This issue or pull request already exists label Oct 21, 2026
@omarchybot omarchybot closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy update stops on sudo -v in the quiet boot migration under passwordless sudo

2 participants