bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #42597] Alpha sorting for kernel names without versions (rolling re


From: Troy Engel
Subject: [bug #42597] Alpha sorting for kernel names without versions (rolling release)
Date: Sun, 22 Jun 2014 17:32:44 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0

URL:
  <http://savannah.gnu.org/bugs/?42597>

                 Summary: Alpha sorting for kernel names without versions
(rolling release)
                 Project: GNU GRUB
            Submitted by: troyengel
            Submitted on: Sun 22 Jun 2014 12:32:44 PM CDT
                Category: User Interface
                Severity: Major
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: 2.02~beta1
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

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:


  if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") |
version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
    return 0
  else
    return 1
  fi


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).


  if [ $(echo $list | grep -q '[0-9]') ]; then
    linux=`version_find_latest $list`
  else
    artmp=($list)
    linux=${artmp[0]}
  fi


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.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 22 Jun 2014 12:32:44 PM CDT  Name: 10_linux_noversion.patch  Size:
728B   By: troyengel
Patch to check for versions in kernel name first
<http://savannah.gnu.org/bugs/download.php?file_id=31596>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42597>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]