Skip to content

fix: semver sorting for kernel packages - #52

Merged
m-strzelczyk merged 2 commits into
GoogleCloudPlatform:mainfrom
barabo:fix-debian-version-parser
Sep 22, 2026
Merged

m-strzelczyk merged 2 commits into
GoogleCloudPlatform:mainfrom
barabo:fix-debian-version-parser

Conversation

@barabo

@barabo barabo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The current Debian installer does not sort kernel version numbers using semver, so when the headers version jumped from 96 to 105 - the wrong version is selected.

This change creates a comparator that respects both ABI and kernel version numbers numerically.

@barabo
barabo requested a review from m-strzelczyk as a code owner August 31, 2026 18:05
@barabo

barabo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

See #53

@barabo

barabo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

You might also consider letting apt decide which kernel versions to use with something like:

self.run("apt-get install -y make gcc linux-image-cloud-amd64 "
         "linux-headers-cloud-amd64 pciutils gcc make dkms cmake git")

I'm assuming there's a good reason for parsing version numbers explicitly, but it might be better to let apt do this.

@m-strzelczyk

Copy link
Copy Markdown
Collaborator

Hey @barabo ! I remember that I had a good reason to not let APT figure out the versions and I think the answer lies with the comment: # Find the newest version of kernel to update to, but stay with the same major version

I remember there were some weird dependency or header related issues when the script jumped to a major new kernel version. Thanks for the PR, I'll run some tests and get it merged ASAP :)

The tool is required to run on Python 3.6 (that's the version installed by default on Rocky 8 and RHEL 8), so I had to modify the type hints a bit.
@m-strzelczyk
m-strzelczyk merged commit 4f182a5 into GoogleCloudPlatform:main Sep 22, 2026
6 checks passed
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.

2 participants