SHA256
1
0
forked from pool/grub2
grub2/grub2-linux-submenu.patch
2011-07-13 13:58:47 +00:00

27 lines
676 B
Diff

Index: grub-1.99/util/grub.d/10_linux.in
===================================================================
--- grub-1.99.orig/util/grub.d/10_linux.in
+++ grub-1.99/util/grub.d/10_linux.in
@@ -144,6 +144,7 @@ esac
prepare_boot_cache=
prepare_root_cache=
+in_submenu=false
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
echo "Found linux image: $linux" >&2
@@ -196,4 +197,13 @@ while [ "x$list" != "x" ] ; do
fi
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+
+ if [ "$list" ] && ! $in_submenu; then
+ echo "submenu \"Previous Linux versions\" {"
+ in_submenu=:
+ fi
done
+
+if $in_submenu; then
+ echo "}"
+fi