GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: look kernels up by release in --uninstall and chk_kernel by davmonk · Pull Request #32 · tmiland/kernel-installer

Conversation

@davmonk

@davmonk davmonk commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #31.

Change

  • kernel_release() maps a kernel.org version to the release the build produces: 7.3-rc7 → 7.3.0-rc7, 7.3 → 7.3.0. Versions that already have a SUBLEVEL (6.12.113, 7.0.0-38-generic, 6.17.1-300.fc44.x86_64) are returned unchanged.
  • installed_kernel_pkg <name> <release> prints the installed package or fails. For rpm it tries name-release and then name-${release//-/_} (the binrpm-pkg form), so distro kernels with a - in their release still match.
  • --uninstall uses both, removes everything it found in one apt purge / dnf remove call, and fails with "No installed kernel packages found for …" instead of silently exiting 0.
  • chk_kernel uses both for the "already installed" check.

Tests

Real script, fake root, Linux Mint 22.3. A stub dpkg reports linux-{image,headers}-7.3.0-rc7 installed and passes everything else to the real dpkg; a stub apt records calls.

case main this branch
-u -k 7.3-rc7 exit 0, no apt call apt purge linux-headers-7.3.0-rc7 linux-image-7.3.0-rc7
-u -k 9.9.9 (nothing installed) exit 0, silent exit 1, "No installed kernel packages found for 9.9.9 …"
-u -k 7.0.0-38-generic (real dpkg/apt, installed distro kernel) reaches apt purge (stopped by "are you root?") same
install -k 7.3-rc7 with the image "installed" check misses, goes on to the download "Kernel 7.3-rc7 is already installed. Process aborted"

RPM, against a scratch rpm database holding the real kernel-7.3.0_rc7-2 and kernel-devel-7.3.0_rc7-2 built with make binrpm-pkg: installed_kernel_pkg kernel "$(kernel_release 7.3-rc7)" returns kernel-7.3.0_rc7 (and kernel-devel-7.3.0_rc7); main's query kernel-7.3-rc7 returns "not installed".

New tests/test_kernel_release.sh, 19 checks: the mapping table, Debian and RHEL lookups against a fake package db (including the distro-kernel cases), and the call sites. main + test: fails (functions missing); this branch: 19/19 ok.

CI: the install matrix (Debian 12/13, Ubuntu 22.04/24.04, Fedora 44) gets an Uninstall kernel step after Verify installation. It runs --uninstall -k $KERNEL_VERSION with real root and asserts the image and headers/devel packages are gone. Uninstall had no CI coverage before. The install log is preserved for the artifact.

shellcheck 0.11.0: no new findings; the test is clean. Merges cleanly with all other open PRs.

Not verified

  • The new CI step and Tests workflow have not run on GitHub yet (awaiting workflow approval). In particular, real apt purge/dnf remove under root were only reached locally, not completed.
  • That uses 6.12.112, where release = version; the mismatch case is covered by the local runs and the unit test, not by CI.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@davmonk @claude
fix: look kernels up by release in --uninstall and chk_kernel
0bdb258
Packages built by the installer are named after the kernel release from
the Makefile, which always has a SUBLEVEL: -k 7.3-rc7 builds
linux-image-7.3.0-rc7 (rpm: kernel-7.3.0_rc7, as binrpm-pkg writes - as
_), and a 7.3 release builds 7.3.0. --uninstall and the "already
installed" check queried linux-image-${LINUX_VER} / kernel-${LINUX_VER},
so for mainline and x.y kernels uninstall silently did nothing (exit 0)
and the check never fired.

Add kernel_release() (7.3-rc7 -> 7.3.0-rc7, 7.3 -> 7.3.0, x.y.z and
distro releases unchanged) and installed_kernel_pkg(), which also tries
the _ form for rpm while keeping distro kernels such as
kernel-6.17.1-300.fc44.x86_64 working. --uninstall now removes all found
packages in one transaction and fails with a message when none is
installed.

Adds tests/test_kernel_release.sh, the Tests workflow, and an uninstall
step to every distro in the install CI matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@davmonk davmonk mentioned this pull request Oct 16, 2026
fix: read prompts from the terminal when the script is piped in #34
Merged
@tmiland
tmiland merged commit db6292c into tmiland:main Oct 17, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@tmiland-labs

tmiland-labs commented Oct 17, 2026

Copy link
Copy Markdown

Thanks @davmonk — merged. Looking kernels up by release in --uninstall and the installed-kernel check now covers mainline and x.y kernels too. 🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davmonk
davmonk deleted the fix/uninstall-kernel-release branch October 17, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

--uninstall and the "already installed" check miss mainline and x.y kernels

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@davmonk @tmiland-labs @tmiland
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.