os-prober 90fallback - kernels detected out of order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-prober (Ubuntu) |
Fix Released
|
Undecided
|
Dimitri John Ledkov |
Bug Description
Ubuntu information at the end of this message. When detecting kernels in other distributions like CentOS on the same disk, the kernels are incorrectly sorted numerically.
e.g. this is the current incorrect jumbled result from grub-mkconfig:
vmlinuz-
vmlinuz-
vmlinuz-
vmlinuz-
vmlinuz-
The correct order where the newest kernels are at the top is like so:
vmlinuz-
vmlinuz-
vmlinuz-
vmlinuz-
vmlinuz-
To resolve this, /usr/lib/
-t sort by modification time, newest first
I've made the below change to my local 90fallback script and verified that the kernels are now listed in the correct order:
22c22
< for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do
---
> for kernfile in $(eval ls -t "$mpoint$kernpat" 2>/dev/null); do
Please make this correction to os-prober so I do not have to manually modify /boot/grub/grub.cfg every time my multi-boot laptop gets new updated kernels. Thanks in advance.
-- Mario Chamorro
[mchamorr-ubuntu:~] lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04
[mchamorr-ubuntu:~] apt-cache policy os-prober
os-prober:
Installed: 1.63ubuntu1
Candidate: 1.63ubuntu1
Version table:
*** 1.63ubuntu1 0
500 http://
100 /var/lib/
[mchamorr-ubuntu:~]
Changed in os-prober (Ubuntu): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in os-prober (Ubuntu): | |
status: | New → Fix Committed |
Here is my solution to the issue - this was created using 'diff -u':
--- 90fallback.0 2012-04-04 13:17:21.000000000 -0400 ="$partition" =$(echo "$kernfile" | sed "s!^$mpoint!!") $(echo "$kernfile" | sed "s/vmlinu[ zx]/initrd\ */")
+++ 90fallback 2014-05-07 09:59:12.283599302 -0400
@@ -19,7 +19,7 @@
else
kernbootpart
fi
- for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do
+ for kernfile in $(eval ls -t "$mpoint$kernpat" 2>/dev/null); do
kernbasefile
if [ -f "$kernfile" ] && [ ! -L "$kernfile" ]; then
initrdname=