grub2-mkconfig does not sort the available kernels in /boot/ by their versions. Reproducible: Always Steps to Reproduce: 1. Copy different kernels to /boot/ (I used genkernel), lets say kernel-genkernel-x86_64-3.2.6-gentoo, kernel-genkernel-x86_64-3.2.9-gentoo and kernel-genkernel-x86_64-3.2.11-gentoo 2. Run "sudo grub2-mkconfig -o /boot/grub2/grub.cfg" Actual Results: $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub.cfg ... Found linux image: /boot/kernel-genkernel-x86_64-3.2.9-gentoo Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.9-gentoo Found linux image: /boot/kernel-genkernel-x86_64-3.2.6-gentoo Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.6-gentoo Found linux image: /boot/kernel-genkernel-x86_64-3.2.11-gentoo Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.11-gentoo Found memtest86+ image: /boot/memtest86plus/memtest done # The kernel order is 3.2.9, 3.2.6, 3.2.11 Expected Results: Generating grub.cfg ... Found linux image: /boot/kernel-genkernel-x86_64-3.2.11-gentoo Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.11-gentoo Found linux image: /boot/kernel-genkernel-x86_64-3.2.9-gentoo Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.9-gentoo Found linux image: /boot/kernel-genkernel-x86_64-3.2.6-gentoo Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.6-gentoo Found memtest86+ image: /boot/memtest86plus/memtest done # The kernel order is 3.2.11, 3.2.9, 3.2.6 The error is in /usr/share/grub/grub-mkconfig_lib, line 196, bash function version_sort(). To sort the kernel versions, sort (/usr/bin/sort) is used with option -V (version sort), if available. The test if sort accepts option -V (uppercase), actually tests if -v (lowercase) is accepted. After changing the test to really test if -V is accepted, the kernels are listed in the correct (descending) version sort order.
Created attachment 305335 [details, diff] Patch /usr/share/grub/grub-mkconfig_lib to test for "sort -V"
Created attachment 305337 [details] emerge --info
Yeah, I reported that upstream on Monday. See URL.
I ran into a curious problem ,due to the non sorting I deleted all but the 3.2.11 branch and when rerunning grub-mkconfig it did not pick up the existing kernel in boot,this happened on both x86 /x86_64 both AMD machines. Any ideas ???????? Geoff
(In reply to comment #4) > Any ideas ???????? It sounds like you deleted all your kernels, not just the old ones. Please ask for support in an official support channel (not bugzilla). Personally, I hang out in #gentoo quite often, so feel free to ping me there. http://www.gentoo.org/main/en/support.xml
This has been fixed upstream. I'll keep this open until beta3 is in the tree.
(In reply to comment #3) > Yeah, I reported that upstream on Monday. See URL. I've searched upstream bugtracker and reported https://savannah.gnu.org/bugs/index.php?35888 on Sunday. Can you please add an revbump -r1 with this patch included? I ran into this isse several times esp. with kernels 3.2.9 and 3.2.11. Thanks
+*grub-2.00_beta2-r1 (20 Mar 2012) + + 20 Mar 2012; Mike Gilbert <floppym@gentoo.org> +grub-2.00_beta2-r1.ebuild: + Fix bug 408196. +
(In reply to comment #8) > +*grub-2.00_beta2-r1 (20 Mar 2012) > + > + 20 Mar 2012; Mike Gilbert <floppym@gentoo.org> +grub-2.00_beta2-r1.ebuild: > + Fix bug 408196. > + The changelog entry has a typo. This bug is numbered 408196
(In reply to comment #9) > (In reply to comment #8) > > +*grub-2.00_beta2-r1 (20 Mar 2012) > > + > > + 20 Mar 2012; Mike Gilbert <floppym@gentoo.org> +grub-2.00_beta2-r1.ebuild: > > + Fix bug 408196. > > + > > The changelog entry has a typo. This bug is numbered 408196 This comment has a typo. This bug is numbered 408195 :)