0e50f1f
Until we're able to decide which kernel to make default (e.g with grubby),
0e50f1f
pick the most recent one.
0e50f1f
0e50f1f
Lubomir Rintel <lkundrak@v3.sk>
0e50f1f
0e50f1f
Index: util/grub.d/10_linux.in
0e50f1f
===================================================================
0e50f1f
--- util/grub.d/10_linux.in	(revision 1797)
0e50f1f
+++ util/grub.d/10_linux.in	(working copy)
0e50f1f
@@ -82,23 +82,9 @@
0e50f1f
   return $?
0e50f1f
 }
0e50f1f
 
0e50f1f
-find_latest ()
0e50f1f
-{
0e50f1f
-  local a=""
0e50f1f
-  for i in $@ ; do
0e50f1f
-    if test_gt "$i" "$a" ; then
0e50f1f
-      a="$i"
0e50f1f
-    fi
0e50f1f
-  done
0e50f1f
-  echo "$a"
0e50f1f
-}
0e50f1f
-
0e50f1f
-list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
0e50f1f
-        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
0e50f1f
-      done`
0e50f1f
-
0e50f1f
-while [ "x$list" != "x" ] ; do
0e50f1f
-  linux=`find_latest $list`
0e50f1f
+ls -c /boot/vmlinu[xz]-* /vmlinu[xz]-* 2>/dev/null |while read linux
0e50f1f
+do
0e50f1f
+  grub_file_is_not_garbage "$linux" || continue
0e50f1f
   echo "Found linux image: $linux" >&2
0e50f1f
   basename=`basename $linux`
0e50f1f
   dirname=`dirname $linux`