update-grub sorts custom kernel below older/lower package kernels
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Fix Released
|
Low
|
Mate Kukri | ||
Mantic |
Won't Fix
|
Undecided
|
Unassigned | ||
Noble |
Fix Released
|
Low
|
Mate Kukri |
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-
Related branches
- Mate Kukri: Pending requested
-
Diff: 24415 lines (+14830/-1571)133 files modifieddebian/build-efi-images (+13/-13)
debian/canonical-uefi-ca.crt (+25/-0)
debian/changelog (+2062/-0)
debian/control (+17/-17)
debian/default/grub (+1/-1)
debian/grub-check-signatures (+136/-0)
debian/grub-common-run (+8/-0)
debian/grub-common.dirs (+1/-0)
debian/grub-common.install.in (+7/-0)
debian/grub-common.service (+1/-3)
debian/grub-common.templates (+53/-0)
debian/grub-grubenv-rebuild (+47/-0)
debian/grub-multi-install (+428/-0)
debian/grub-pc.templates.in (+5/-0)
debian/grub-sort-version (+56/-0)
debian/patches/Revert-kern-ieee1275-cmain-ppc64-Introduce-flags-to-ident.patch (+52/-0)
debian/patches/Revert-kern-ieee1275-ieee1275-Display-successful-memory-c.patch (+52/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Add-support-for-alignment.patch (+48/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Decide-by-request-whether.patch (+60/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Display-upper_mem_limit-w.patch (+24/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Fix-a-comment.patch (+22/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Introduce-a-request-for-r.patch (+164/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Rename-regions_claim-to-g.patch (+58/-0)
debian/patches/Revert-kern-ieee1275-init-ppc64-Return-allocated-address-.patch (+36/-0)
debian/patches/Revert-loader-powerpc-ieee1275-Use-new-allocation-functio.patch (+99/-0)
debian/patches/enable_grubenv_with_unwritable_fs_on_efi.patch (+208/-0)
debian/patches/gfxpayload-dynamic.patch (+3/-3)
debian/patches/grub-install-efi-title.patch (+165/-0)
debian/patches/grub-sort-version.patch (+52/-0)
debian/patches/hwmatch-only-on-grub-pc-platform.patch (+2/-2)
debian/patches/insmod-xzio-and-lzopio-on-xen.patch (+2/-2)
debian/patches/maybe-quiet.patch (+2/-2)
debian/patches/mkconfig-recovery-title.patch (+2/-2)
debian/patches/mkconfig-ubuntu-distributor.patch (+1/-1)
debian/patches/mkconfig-ubuntu-recovery.patch (+17/-9)
debian/patches/quick-boot.patch (+2/-2)
debian/patches/recovery-dis_ucode_ldr.patch (+2/-2)
debian/patches/revert-term-ns8250-spcr.patch (+195/-0)
debian/patches/rhboot-f34-dont-use-int-for-efi-status.patch (+23/-0)
debian/patches/rhboot-f34-make-exit-take-a-return-code.patch (+280/-0)
debian/patches/series (+43/-3)
debian/patches/suse-grub.texi-add-net_bootp6-document.patch (+49/-0)
debian/patches/ubuntu-add-devicetree-command-support.patch (+51/-0)
debian/patches/ubuntu-add-initrd-less-boot-fallback.patch (+212/-0)
debian/patches/ubuntu-add-initrd-less-boot-messages.patch (+68/-0)
debian/patches/ubuntu-boot-from-multipath-dependent-symlink.patch (+68/-0)
debian/patches/ubuntu-dont-verify-loopback-images.patch (+35/-0)
debian/patches/ubuntu-fix-lzma-decompressor-objcopy.patch (+29/-0)
debian/patches/ubuntu-grub-install-extra-removable.patch (+65/-39)
debian/patches/ubuntu-install-signed.patch (+42/-41)
debian/patches/ubuntu-mkconfig-leave-breadcrumbs.patch (+28/-0)
debian/patches/ubuntu-os-prober-auto.patch (+51/-0)
debian/patches/ubuntu-recovery-dis_ucode_ldr.patch (+67/-0)
debian/patches/ubuntu-resilient-boot-boot-order.patch (+236/-0)
debian/patches/ubuntu-resilient-boot-ignore-alternative-esps.patch (+212/-0)
debian/patches/ubuntu-shorter-version-info.patch (+40/-0)
debian/patches/ubuntu-speed-zsys-history.patch (+157/-0)
debian/patches/ubuntu-support-initrd-less-boot.patch (+80/-0)
debian/patches/ubuntu-verifiers-last.patch (+59/-0)
debian/patches/ubuntu-zfs-enhance-support.patch (+1048/-0)
debian/patches/ubuntu-zfs-gfxpayload-dynamic.patch (+95/-0)
debian/patches/ubuntu-zfs-gfxpayload-keep-default.patch (+38/-0)
debian/patches/ubuntu-zfs-insmod-xzio-and-lzopio-on-xen.patch (+32/-0)
debian/patches/ubuntu-zfs-mkconfig-recovery-title.patch (+49/-0)
debian/patches/ubuntu-zfs-mkconfig-signed-kernel.patch (+93/-0)
debian/patches/ubuntu-zfs-mkconfig-ubuntu-distributor.patch (+36/-0)
debian/patches/ubuntu-zfs-mkconfig-ubuntu-recovery.patch (+66/-0)
debian/patches/ubuntu-zfs-vt-handoff.patch (+77/-0)
debian/patches/vt-handoff.patch (+4/-4)
debian/po/ar.po (+105/-18)
debian/po/ast.po (+113/-18)
debian/po/be.po (+124/-18)
debian/po/bg.po (+125/-18)
debian/po/ca.po (+126/-18)
debian/po/cs.po (+124/-18)
debian/po/cy.po (+126/-18)
debian/po/da.po (+125/-18)
debian/po/de.po (+128/-18)
debian/po/dz.po (+113/-18)
debian/po/el.po (+140/-33)
debian/po/eo.po (+124/-18)
debian/po/es.po (+125/-18)
debian/po/eu.po (+124/-18)
debian/po/fa.po (+114/-18)
debian/po/fi.po (+124/-18)
debian/po/fr.po (+142/-33)
debian/po/gl.po (+114/-18)
debian/po/gu.po (+112/-18)
debian/po/he.po (+123/-18)
debian/po/hr.po (+124/-18)
debian/po/hu.po (+115/-18)
debian/po/id.po (+125/-18)
debian/po/is.po (+125/-18)
debian/po/it.po (+126/-18)
debian/po/ja.po (+125/-18)
debian/po/ka.po (+93/-18)
debian/po/kk.po (+125/-18)
debian/po/km.po (+112/-18)
debian/po/ko.po (+124/-18)
debian/po/lt.po (+124/-18)
debian/po/lv.po (+124/-18)
debian/po/mr.po (+123/-18)
debian/po/nb.po (+135/-31)
debian/po/nl.po (+126/-18)
debian/po/pl.po (+126/-18)
debian/po/pt.po (+126/-18)
debian/po/pt_BR.po (+126/-18)
debian/po/ro.po (+271/-157)
debian/po/ru.po (+133/-27)
debian/po/si.po (+112/-18)
debian/po/sk.po (+113/-18)
debian/po/sl.po (+124/-18)
debian/po/sq.po (+111/-18)
debian/po/sr.po (+113/-18)
debian/po/sr@latin.po (+113/-18)
debian/po/sv.po (+125/-18)
debian/po/ta.po (+112/-18)
debian/po/templates.pot (+93/-18)
debian/po/th.po (+123/-18)
debian/po/tr.po (+124/-18)
debian/po/ug.po (+125/-18)
debian/po/uk.po (+124/-18)
debian/po/vi.po (+125/-18)
debian/po/zh_CN.po (+111/-18)
debian/po/zh_TW.po (+122/-18)
debian/postinst.in (+92/-14)
debian/rules (+84/-8)
debian/sbat.ubuntu.csv.in (+4/-0)
debian/signing-template/control.in (+1/-1)
debian/templates.in (+83/-8)
debian/test_grub_sort_version.py (+72/-0)
debian/update-grub (+4/-0)
dev/null (+0/-195)
- Julian Andres Klode: Pending requested
-
Diff: 863 lines (+280/-234)12 files modifieddebian/build-efi-images (+6/-0)
debian/changelog (+26/-0)
debian/control (+2/-0)
debian/grub-sort-version (+2/-2)
debian/patches/grub-sort-version.patch (+16/-1)
debian/patches/secure-boot/efi-use-peimage-shim.patch (+146/-224)
debian/patches/suse-grub.texi-add-net_bootp6-document.patch (+3/-3)
debian/patches/ubuntu-fix-lzma-decompressor-objcopy.patch (+1/-1)
debian/patches/ubuntu-support-initrd-less-boot.patch (+1/-1)
debian/rules (+3/-0)
debian/sbat.ubuntu.csv.in (+2/-2)
debian/test_grub_sort_version.py (+72/-0)
CVE References
tags: | added: foundations-todo |
Changed in grub2 (Ubuntu Noble): | |
assignee: | nobody → Julian Andres Klode (juliank) |
Changed in grub2 (Ubuntu Noble): | |
assignee: | Julian Andres Klode (juliank) → Mate Kukri (mkukri) |
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