update-grub sorts custom kernel below older/lower package kernels
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
grub2 (Ubuntu) | Status tracked in Noble | |||||
Mantic |
New
|
Undecided
|
Unassigned | |||
Noble |
Triaged
|
Low
|
Julian Andres Klode |
Bug Description
Since the upgrade to 23.10 my custom built kernels do not sort on top of grub menu anymore, even though their number is higher than the packaged kernels:
See the output of grub-sort-version -r for the default kernel list on my system, as constructed by /etc/grub.
# for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do echo $i; list="$list $i"; done
/boot/vmlinuz-
/boot/vmlinuz-
/boot/vmlinuz-6.5.8
/boot/vmlinuz-6.5.9
/boot/vmlinuz-6.6.0
/vmlinuz-*
/boot/kernel-*
# echo $list | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | /usr/lib/
/vmlinuz-*
/boot/vmlinuz-
/boot/vmlinuz-
/boot/vmlinuz-6.6.0 <!--- Used to be on top before 23.10
/boot/vmlinuz-6.5.9
/boot/vmlinuz-6.5.8
/boot/kernel-*
As can be seen from the output, /boot/vmlinuz-
tags: | added: foundations-todo |
Changed in grub2 (Ubuntu Noble): | |
assignee: | nobody → Julian Andres Klode (juliank) |
Thank you for your bug report! This was quite a doozy.
Yes, this happens because your version number is missing a - and the script doesn't extract versions from the filenames, hence APT ends up parsing the version as
upstream: vmlinuz, revision: 6.6.0
whereas versions with a - in it like official ones are parsed as e.g.:
upstream: vmlinuz-6.5.0-10, revision: generic