fix: resolve kernel version detection for Debian/Ubuntu meta-packages #37
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.
Fix: Resolve kernel version detection for Debian/Ubuntu meta-packages
Problem
On Debian-based virtualized systems, the agent incorrectly reported kernel version mismatches, causing false-positive reboot requirements. The issue occurred because meta-packages like
linux-image-virtual,linux-image-generic, etc., were not being resolved to their actual kernel versions.Changes
1. Updated
getLatestKernelFromBoot()6.8.0-90-genericfrom/bootdirectory2. Rewrote
getLatestKernelFromDpkg()3. Added
resolveMetaPackage()dpkg-queryto read package dependenciesTesting
Tested on Raspberry Pi 5 (Debian 13)
Correctly detects matching kernels with custom suffixes
Tested on Proxmox VE
Correctly detects actual kernel updates requiring reboot
Tested on Ubuntu 24.04 (Virtualized)
Before fix:
False positive - meta-package not resolved
After fix:
Correctly resolves
linux-image-virtualto6.8.0-90-genericImpact
Notes (important)
Testing required before merge
This fix has been tested on Debian-based systems (Debian 13, Ubuntu 24.04, Raspberry Pi OS). I only had VMs/physical devices with these distributions in my home lab. Before merging, it should be tested on all OS distributions (all those officially supported by the project).