Bug#741889: os-prober: The 90fallback script lists the least recent kernels first
Package: os-prober
Version: 1.63
Severity: normal
Tags: patch
Hi,
when detecting kernels on a linux system without grub/lilo, the 90fallback
script is used, which looks for kernel/image files in a few well-known
locations using 'ls'. This makes the output least-recent-first ordered, causing
grub to use the oldest kernel as default, making it necessary to use a submenu
to boot the most recent one.
Attaching a patch reversing the ordering.
Regards,
WG
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (500, 'testing'), (100, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.13-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- linux-boot-probes/mounted/common/90fallback 2011-02-10 03:00:20.000000000 +0100
+++ linux-boot-probes/mounted/common/90fallback.new 2014-03-17 00:56:49.001460861 +0100
@@ -19,7 +19,7 @@
else
kernbootpart="$partition"
fi
- for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do
+ for kernfile in $(eval ls -r "$mpoint$kernpat" 2>/dev/null); do
kernbasefile=$(echo "$kernfile" | sed "s!^$mpoint!!")
if [ -f "$kernfile" ] && [ ! -L "$kernfile" ]; then
initrdname=$(echo "$kernfile" | sed "s/vmlinu[zx]/initrd\*/")
Reply to: