Skip to content

el: remove an old kernel's BLS entry with its files - #97

Merged
TusanHomichi merged 1 commit into
mainfrom
claude/project-thread-qturuz
Oct 14, 2026
Merged

TusanHomichi merged 1 commit into
mainfrom
claude/project-thread-qturuz

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

What this adds

Route: none. This is a maintainer change to the EL hop's kernel cleanup (adapters/el.toml, hop.kernel_before).
New fixes: none.
Claims issue: none. remi found the problem on the real-VM gate run for #92.

Before: after centos8-lamp reached Alma 10 on a real VM, /boot/loader/entries still held the CentOS 8 4.18.0-348.7.1.el8_5 entry. The cleanup had deleted its vmlinuz, so GRUB listed a dead CentOS 8 entry. It wasn't the default, but anyone picking it from the menu got a boot failure.

After: when the cleanup removes an old kernel no package owns, it also removes every BLS entry whose linux line boots that vmlinuz. The running kernel's entries stay, and so do entries for kernels a package owns and non-kernel entries.

How:

  • One loop is added after the existing per-kernel rm. It matches the entry's linux path by basename, so it covers both /vmlinuz-v (separate /boot) and /boot/vmlinuz-v.
  • SPEC "Kernels and the bootloader" and the adapter comment say so.
  • tools/test_grub.py runs the cleanup on a fixture /boot that has running, owned, old and memtest entries. A mutation check confirmed it fails without the change.
  • centos8-lamp and centos7-lamp get a VM live check, boot_entries: no BLS entry may boot a kernel that isn't in /boot. EL7 has no entries, and the transit EL8 kernel on the CentOS 7 route is covered too.

Model

claude-code / opus 5.5 (agent), hand-written

Evidence

No route×box pair is affected (tools/affected.py origin/main returns []). The cleanup only runs on a booted VM, never in the chroot tier. wend check is ok, tools/test_grub.py passes 3/3, and the client parity check reports identical. The real-VM proof is pending: remi reruns centos8-lamp → Alma 10 on this head.

Self-review (AGENTS.md step 5)

  • Every precondition is as narrow as I can make it, and ./wend verify found no decoy hits (no fixes changed)
  • Every fix fixes the real problem, not the symptom a check inspects
  • One problem per fix; load-bearing steps (like repair) kept
  • No edits to tools/, adapters/, SPEC.md, .github/, other boxes' roles, or other people's fixes (except fires_on). This is maintainer harness work, the same precedent as spec: strict mysql.upgrade-data, rpm.drop-unneeded, transit kernel in the /boot preflight #89 and route: el centos8 -> alma10 #92. Only [vm].live is added to the two boxes; [roles] is untouched.
  • Commits are signed off (git commit -s)

🤖 Generated with Claude Code

https://claude.ai/code/session_01U79sdXK2gVuGi4U9ty7qHc


Generated by Claude Code

The kernel cleanup before each EL transaction removes the files of old
kernels no package owns, but left their /boot/loader/entries/*.conf
behind. EL8 writes one entry per kernel, so after centos8-lamp reached
Alma 10 on a real VM GRUB still listed a dead CentOS 8 4.18 entry
pointing at a deleted vmlinuz. The cleanup now removes every BLS entry
whose linux line boots the removed vmlinuz.

centos8-lamp and centos7-lamp get a VM live check that no BLS entry
boots a kernel that isn't in /boot. tools/test_grub.py runs the cleanup
on a fixture /boot.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01U79sdXK2gVuGi4U9ty7qHc
Signed-off-by: Claude <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T12:53:54.485589Z 066b3b1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Member Author

Independent review: signed off at head 066b3b1.

What I checked:

  • adapters/el.toml hop.kernel_before[1], the BLS loop. The TOML escaping decodes cleanly. The decoded step parses under bash -n, bash --posix -n and dash -n. The loop is plain POSIX: a for over a glob, [ -f ] || continue, $(awk ...) and ${k##*/}. Nothing in it needs anything newer than EL5's bash 3.2. On CentOS 5 the glob stays literal, the -f test fails and the loop does nothing. The loop sits inside the per-kernel loop, after the existing 0-rescue-*|$R|$D|$K exclusions and the rpm -qf ownership check. So it only removes entries for kernels whose files are already being removed. It matches on the basename of the linux path, which covers both /vmlinuz-x and /boot/vmlinuz-x. Rescue entries are still handled only by the existing rescue logic.
  • Extra behaviour runs. I ran the decoded step under dash on a fixture with no package owning anything: the running kernel is unowned, GRUB 2's saved_entry names an old kernel's BLS entry, and there is a rescue image. The running kernel's entry and the default kernel's entry both stayed. Only the other old kernel's entry was removed, and the rescue logic was unchanged. With no /boot/loader/entries directory (the EL5 case), the step produced no new output and exited 0.
  • The [vm].live boot_entries check. "/boot${k#/boot}" resolves both /vmlinuz-x and /boot/vmlinuz-x to /boot/vmlinuz-x. It parses under bash and dash and uses nothing past bash 4.2. With no BLS directory (EL7) it exits 0.
  • Tests. python3 -B tools/test_grub.py passes, and python3 tools/check.py reports 68 fixes, 5 routes, 10 boxes, 81 runs: ok. I swapped the parent commit's el.toml into a copy of the tree, and the new test fails there, so it catches the regression.

Non-blocking notes:

  • tools/test_grub.py:79: the fake rpm owns RUN, so the test never runs the $R (running kernel) exclusion. In a real handover, kernel_before[0] has already dropped the running kernel's rpm record, so that exclusion is the one that protects it. The GRUB-default ($K) exclusion isn't covered by the test either. I checked both by hand (above). Making RUN unowned and adding a saved_entry case would cover them.
  • adapters/el.toml:197: the comment line is 151 characters; the lines around it are 120 or less.

Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 066b3b1445

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread adapters/el.toml Resolved
@github-actions github-actions Bot added the needs-claude-review Waiting on the Claude review layer label Oct 14, 2026
@TusanHomichi
TusanHomichi merged commit 798d783 into main Oct 14, 2026
11 checks passed
@TusanHomichi
TusanHomichi deleted the claude/project-thread-qturuz branch October 14, 2026 14:37
TusanHomichi pushed a commit that referenced this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-claude-review Waiting on the Claude review layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants