Skip to content

Clear unowned running-kernel modules leftovers during update - #9285

Open
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9142-kernel-modules-overwrite
Open

Clear unowned running-kernel modules leftovers during update#9285
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9142-kernel-modules-overwrite

Conversation

@fresh3nough

Copy link
Copy Markdown

Summary

Fixes #9142.

After a kernel downgrade (e.g. omarchy-dev → stable release migration) while still booted into the newer kver, kernel-modules-hook restores /usr/lib/modules/$(uname -r)/ as unowned files so the live system keeps working. Pacman's file-conflict check runs before PreTransaction hooks, so 10-linux-modules-pre never clears them, and linux-modules-cleanup.service skips the running kver. The next omarchy update that re-offers that kernel fails with thousands of exists in filesystem lines and no recovery.

The existing conflict handler only auto-cleared leftovers blamed on omarchy / omarchy-settings packages, so linux: module conflicts fell through.

Change

In omarchy-update-system-pkgs-when-conflicted, when every reported filesystem conflict is an unowned path under /usr/lib/modules/$(uname -r), quarantine that modules tree once (same replace/restore path as other leftovers) and retry the upgrade.

Test plan

  • Reproduced: old omarchy* -only parse yields 0 leftovers for linux: .../modules/... conflicts (update stays wedged)
  • After fix: whole running-kver tree quarantined; retry succeeds
  • Mixed / non-running-kver conflicts still refused
  • ./test/shell.d/update-file-conflict-test.sh passes (existing + new cases)
./test/shell.d/update-file-conflict-test.sh

kernel-modules-hook restores the booted kver's module tree as unowned
files after a linux downgrade. Pacman refuses to install over them before
PreTransaction hooks run, so omarchy update stays wedged with thousands of
"exists in filesystem" errors. When every reported conflict is unowned
under /usr/lib/modules/$(uname -r), quarantine that tree once and retry.

Fixes omacom#9142

Signed-off-by: fresh3nough <anonwurcod@proton.me>
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.

omarchy update wedged by unowned kernel-modules-hook leftovers after release-migration kernel downgrade

1 participant