Skip the reboot prompt when the flag predates the current boot - #8724
Open
Pillumz wants to merge 1 commit into
Open
Skip the reboot prompt when the flag predates the current boot#8724Pillumz wants to merge 1 commit into
Pillumz wants to merge 1 commit into
Conversation
Only omarchy-system-reboot clears reboot-required, so a reboot by any other route (systemctl reboot, the power button, a crash) leaves the flag behind and every later update prompts for a reboot that already happened. Compare the flag's mtime with the kernel's boot time and clear it when the reboot has been done.
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents stale reboot prompts by clearing reboot markers created before the current boot.
Changes:
- Compares reboot-marker mtime with
/proc/statboot time. - Adds regression tests for stale, current, and absent markers.
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-update-restart |
Clears reboot markers already honored by a reboot. |
test/shell.d/update-restart-test.sh |
Tests reboot-marker timestamp handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After
omarchy update,omarchy-update-restartkeeps asking "Updates require reboot. Ready?" on a machine that has already rebooted.~/.local/state/omarchy/reboot-requiredis set by migrations and by the sudoless Docker commands (#8080), and the only thing that ever clears it isomarchy-system-reboot. Reboot any other way -systemctl reboot, the power button, a hard reset after a freeze - and the flag survives, so every following update prompts for a reboot that already happened. Saying No leaves it in place; the only way out is to accept the prompt once or delete the file by hand.Seen here on 4.0.1: a migration set the flag on Aug 25, the machine was rebooted on Aug 27 outside the Omarchy path, and today's update (three userspace packages and an AUR rebuild, running kernel matching the installed one) still asked for a reboot.
Fix
In the
reboot-requiredbranch, compare the flag's mtime with the kernel's boot time from/proc/stat(btime). A flag written before the current boot has already been honoured, so clear it and move on. A flag written since boot, for example by a migration in the same update run, still prompts as before. The kernel and Hyprland checks are untouched.Tests
New
test/shell.d/update-restart-test.shmocksuname,pacman,pgrep,gumand the reboot/restart commands, pointsHOMEat a temp dir and covers three cases: a flag older than boot is cleared without a prompt, a flag newer than boot prompts and survives a declined prompt, and no flag means no prompt. It skips when there is no kernel under/usr/lib/modules, since the kernel check makes that branch unreachable there.system-power-test.shandupdate-sequence-test.shstill pass.