Skip to content

fix(update): detect aarch64 kernels without vmlinuz - #10232

Closed
kvnloo wants to merge 3 commits into
omacom:quattrofrom
kvnloo:fix/10048-aarch64-kernel-check
Closed

kvnloo wants to merge 3 commits into
omacom:quattrofrom
kvnloo:fix/10048-aarch64-kernel-check

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • match running kernel against pacman-owned /usr/lib/modules/*/ dirs
  • stop requiring vmlinuz so linux-aarch64 (Image) no longer always prompts reboot

Fixes #10048.

Verification

  • bash -n bin/omarchy-update-restart
  • running modules dir → kernel_updated=false without vmlinuz

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matching the modules dir (not vmlinuz) is what aarch64 needs. good.

@kvnloo

kvnloo commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Salvaged into the Chessing234-approved leftover wave: #11555

Cherry-picked onto current quattro with author normalized to @kvnloo (Kevin Rajan <[email protected]>; lesseradmin is the same account). Please merge #11555 as the tranche and close this head as salvaged.

@kvnloo

kvnloo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Salvaged into #12956 (cluster with #10231). Please close this head as salvaged after that lands.

quattro wrapped the kernel check in the --services-only guard; the modules-directory loop moves inside it unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a disposable Omarchy worker (x86_64, linux-omarchy 7.2.5-3). The fix works and is proportionate to #10048.

Pushed: 18bf2d8 merges quattro into this branch. quattro had wrapped the kernel check in the new --services-only guard, which caused the conflict. Your modules-directory loop now sits inside that guard, unchanged, and the pull request merges cleanly again.

Reproduced: with the running kernel's vmlinuz moved aside (the linux-aarch64 layout) and the real pacman database, bin/omarchy-update-restart --reboot-only on quattro asks "Linux kernel has been updated. Reboot?" and this head does not. With vmlinuz in place, neither asks. It still asks when the running kernel's package is gone, including when kernel-modules-hook has left an unowned copy of that kernel's modules directory behind. test/shell.d/update-restart-kernel-test.sh passes on this head (3 of 3) and fails against quattro's script.

Suite: ./test/cli and ./test/shell have 9 failures on this head. They are the same 9 on unchanged quattro (vscode theme, ascii, about animation, two kernel migrations, browser launch, captive portal, passwordless grant, video background), so this change does not cause them, but the suite is not green.

Second opinion: Codex Medium agreed the problem is real and the diff proportionate (it had seen my conclusions, so this agreement is not independent). It also found something I had not looked at. pacman -Qo /usr/lib/modules/<ver>/ names linux-omarchy-headers as well as linux-omarchy, so if a kernel is upgraded while its old headers stay installed, the old directory still counts as installed and no reboot is offered. The old vmlinuz check could not be fooled that way. A normal -Syu upgrades both packages together, so this only bites on a partial upgrade. Checking ownership of <dir>/modules.builtin, which only the kernel package ships and which modules_install installs on aarch64 too, would close it. I have not changed that, because I could not confirm the ARM package's file list from here. Codex added that pkgbase would not work as a substitute because linux-aarch64 does not ship it.

Related: #12956 carries this same hunk bundled with an unrelated herdr keybinding change. This is the focused one.

Waiting on the maintainer: whether the headers-ownership case is worth tightening before it lands.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 2, 2026
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Changes kernel update detection logic in system restart script.

The PR should not merge until kernel detection distinguishes a remaining headers-owned directory from an installed running kernel.

Findings

  1. P1 Headers can hide kernel removal ▶

Summary

The PR changes post-update kernel detection from ownership of a vmlinuz file to ownership of a modules directory, allowing kernels with a different image filename to be recognized. It adds shell tests for matching, different, and unowned modules directories.

Reviews (1) · Last reviewed commit: "Merge origin/quattro into fix/aarch64 ke..."

# The package-owned modules directory is the architecture-neutral identity.
for modules_dir in "$modules_root"/*/; do
[[ -d $modules_dir ]] || continue
pacman -Qo "$modules_dir" &>/dev/null || continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Headers can hide kernel removal

If the running kernel package is removed but its separately installed headers still own /usr/lib/modules/<running-release>/, this ownership check treats the kernel as installed. The script then skips the kernel-update reboot prompt even though the kernel image is gone. Check the kernel package or image rather than ownership of the shared directory.

@birkskyum

Copy link
Copy Markdown
Contributor

Fixed by #14447 on quattro: the reboot check now looks at modules.builtin, which every kernel package owns, ARM ones included. Closing. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Kernel has been updated. Reboot?" on every update on Arch ARM (linux-aarch64)

4 participants