default kernel order issue with RC and final versions

Bug #1247700 reported by pqwoerituytrueiwoq on 2013-11-04
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

So i have these kernels installed:
Found linux image: /boot/vmlinuz-3.12.0-031200rc7-generic
Found initrd image: /boot/initrd.img-3.12.0-031200rc7-generic
Found linux image: /boot/vmlinuz-3.12.0-031200-generic
Found initrd image: /boot/initrd.img-3.12.0-031200-generic
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found initrd image: /boot/initrd.img-3.11.0-12-generic

When grub.cfg is generated 3.12.0-031200 should be the default kernel but instead 3.12.0-031200rc7 is default
the default should the 3.12 final instead or 3.12 rc7

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: grub2-common 2.00-19ubuntu2.1
Uname: Linux 3.12.0-031200rc7-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: amd64
Date: Sun Nov 3 20:17:46 2013
InstallationDate: Installed on 2013-05-01 (186 days ago)
InstallationMedia: Xubuntu 13.04 "Raring Ringtail" - Release amd64 (20130423.1)
MarkForUpload: True
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

At first, it looks like this is simply because "/boot/vmlinuz-3.12.0-031200rc7-generic" is lexicographically greater than "/boot/vmlinuz-3.12.0-031200-generic", but I haven't actually looked at the source for grub2, and something in /etc/grub.d/10_linux may also be responsible for sorting the entries.

I haven't come across documentation saying whether or not this is expected behavior, but in bug 476540 it was mentioned how the entry sorting was changed to the algorithm used by dpkg. The discussion in http://savannah.gnu.org/bugs/?42597 would indicate this is issue is due to the intended behavior of /etc/grub.d/10_linux, at least upstream. There are several other similar discussions grub2's kernel menu sorting and /etc/grub.d/10_linux.

There was a similar issue reported with update-initramfs that was resolved by using the linux-version command (from linux-base): cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770394 . This might be something to incorporate into /etc/grub.d/10_linux as a solution to this and similar issues.

I happened to be testing mainline kernels at the moment, and as a workaround I use grub-customizer to specify which kernel to boot.

The issue is not present in grub2-2.02~beta2-19 (latest version for 15.04 Vivid)
Using one machine with test kernels, update-grub outputs:

Found linux image: /boot/vmlinuz-3.17.0-custom
Found initrd image: /boot/initrd.img-3.17.0-custom
Found linux image: /boot/vmlinuz-3.17.0-rc1-custom
Found initrd image: /boot/initrd.img-3.17.0-rc1-custom
Found linux image: /boot/vmlinuz-3.16.0-29-generic
Found initrd image: /boot/initrd.img-3.16.0-29-generic

and grub2 lists 3.17.0-custom as the default kernel, not 3.17.0-rc1-custom.

Based on the changelog, this was probably fixed in grub2-2.00-20:
> * Backport from upstream:
> - Sort gnumach kernels in version order (closes: #725451).
> -- Colin Watson <email address hidden> 14 Nov 2013

I will mark this as Incomplete as suggested by the canned responses: "13.10 reached EOL on 17 July 2014…Please upgrade to the latest version and re-test."

Changed in grub2 (Ubuntu):
status: New → Incomplete

i am fairly sure 14.04 is affected, given i recall removing all RCs when i upgrade

Changed in grub2 (Ubuntu):
status: Incomplete → New

Ok, the issue is present in 14.04 with grub2-2.02~beta2-9ubuntu1.

Found linux image: /boot/vmlinuz-3.18.0-031800rc7-generic
Found initrd image: /boot/initrd.img-3.18.0-031800rc7-generic
Found linux image: /boot/vmlinuz-3.18.0-031800-generic
Found initrd image: /boot/initrd.img-3.18.0-031800-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic

and it boots 3.18.0-031800rc7 by default.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed

Using the same packaged mainline kernel example I just did with grub2-2.02~beta2-19, the issue IS still present:

Found linux image: /boot/vmlinuz-3.18.0-031800rc7-generic
Found initrd image: /boot/initrd.img-3.18.0-031800rc7-generic
Found linux image: /boot/vmlinuz-3.18.0-031800-generic
Found initrd image: /boot/initrd.img-3.18.0-031800-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic

and it boots 3.18.0-031800rc7 by default.

So I'm not sure what the discrepancy is between this not working and it working as in comment 3, unfortunately.

Tim Machts (emnil) wrote :

Same problem here. Im using grub2.02~beta2-29ubuntu0.3.

Linux-Abbild gefunden: /boot/vmlinuz-4.6.0-040600rc5-generic
initrd-Abbild gefunden: /boot/initrd.img-4.6.0-040600rc5-generic
Linux-Abbild gefunden: /boot/vmlinuz-4.6.0-040600-generic
initrd-Abbild gefunden: /boot/initrd.img-4.6.0-040600-generic
Linux-Abbild gefunden: /boot/vmlinuz-4.5.2-040502-generic
initrd-Abbild gefunden: /boot/initrd.img-4.5.2-040502-generic
Linux-Abbild gefunden: /boot/vmlinuz-4.5.0-040500-generic
initrd-Abbild gefunden: /boot/initrd.img-4.5.0-040500-generic
...
Kernel 4.6.0-040600rc5-generic boots by default.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.