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/ _______________________________________________ Bug-grub mailing list Bug-grub@gnu.org https://lists.gnu.org/mailman/listinfo/bug-grub