bugGNU GRUB - Bugs: bug #42597, Alpha sorting for kernel names...


You are not allowed to post comments on this tracker with your current authentification level.

bug #42597: Alpha sorting for kernel names without versions (rolling release)

Submitted by:  Troy Engel <troyengel>
Submitted on:  Sun Jun 22 17:32:44 2014  
Category: User InterfaceSeverity: Major
Priority: 5 - NormalItem Group: Feature Request
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: 2.02~beta1Reproducibility: Every Time
Planned Release: 2.03+

Sun Jun 22 17:32:44 2014, original submission:

The /etc/grub.d/10_linux design is based around the expectation that kernel names in /boot will contain version numbers, allowing the newest version to sort to the top and become the default entry. For systems like Fedora/Red Hat/CentOS this works fine.

For rolling release distros like Arch, this causes the last entry in the found list to become the default. For example, if you install the "linux" and "linux-lts" kernels the natural find order in 10_linux is "linux linux-lts".

The callout to version_find_latest results in returning "linux-lts" due to how the code works in grub-mkconfig_lib and specifically version_sort_numeric here:

Attached is my attempt at a basic patch that checks the string of kernels found and if there are no numerics present in them, default to popping them off the stack in order found (natural alpha sort from the "for i in..." code previously).

There is probably a better way to do this, but this simple hack works for the basic Arch install to allow "linux" to be the expected default, leaving "linux-lts" to be available for emergency purposes.

Troy Engel <troyengel>


Attached Files
file #31596:  10_linux_noversion.patch added by troyengel (728B - text/x-patch - Patch to check for versions in kernel name first)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by phcoder (Updated the item)
  • -unavailable- added by troyengel (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Mar 2 12:42:49 2016phcoderPlanned ReleaseNone=>2.03+
    Sun Jun 22 17:32:44 2014troyengelAttached File-=>Added 10_linux_noversion.patch, #31596

    Back to the top

    Powered by Savane 3.1-cleanup1