Skip to content

Refactor kernel enumeration and add UKI reconciliation/retention - #17

Merged
GlitchSlayed merged 1 commit into
mainfrom
codex/refactor-kernel-selection-in-uku-setup.sh
Mar 13, 2026
Merged

GlitchSlayed merged 1 commit into
mainfrom
codex/refactor-kernel-selection-in-uku-setup.sh

Conversation

@GlitchSlayed

Copy link
Copy Markdown
Owner

Motivation

  • Ensure UKIs are created and managed for the full set of kernels actually installed via RPM rather than only for the running kernel.
  • Prevent accidental removal of UKIs for kernels until a successful boot is confirmed to avoid removing a working boot target during upgrades.
  • Provide a maintenance mode to reconcile installed kernels, rebuild missing UKIs, and prune stale artifacts in a controlled, auditable way.

Description

  • Add list_installed_kernels() helper (in uki-setup.sh and the generated uki-build.sh) that enumerates rpm -q kernel results, normalizes them (strip kernel-) and yields versions that have /lib/modules/<ver>/vmlinuz.
  • Change initial setup build phase to iterate list_installed_kernels() and build UKIs for every installed kernel instead of only uname -r.
  • Implement a --reconcile maintenance mode in the generated uki-build.sh that rebuilds UKIs for all installed kernels, detects stale UKIs on the ESP, and prunes stale UKIs/EFI entries only after a boot-success marker exists under BOOT_SUCCESS_DIR (default /var/lib/uki-ukify/boot-success).
  • Update the kernel-install plugin so add, remove, and other invocations call the reconcile mode (instead of deleting by the event kernel version), add helper delete_uki_and_entry() to remove both the UKI file and corresponding EFI boot entry, and document the retention/confirmation behavior in the post-install summary with a manual reconcile invocation (--reconcile) and example confirmation command.

Testing

  • Ran bash -n uki-setup.sh to verify the modified script syntax and it passed.
  • Executed the repository tests with bash tests/test_uki_setup.sh and the test script passed.
  • Ran bash -n tests/test_uki_setup.sh to lint the test and it passed.

Codex Task

@GlitchSlayed
GlitchSlayed merged commit f8f7f6a into main Mar 13, 2026
0 of 2 checks passed
@GlitchSlayed
GlitchSlayed deleted the codex/refactor-kernel-selection-in-uku-setup.sh branch March 19, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant