=== modified file 'util/grub.d/10_linux.in' --- util/grub.d/10_linux.in 2010-11-01 11:49:40 +0000 +++ util/grub.d/10_linux.in 2010-11-25 01:03:00 +0000 @@ -55,15 +55,25 @@ { os="$1" version="$2" - recovery="$3" + type="$3" args="$4" - if ${recovery} ; then - title="$(gettext_quoted "%s, with Linux %s (recovery mode)")" + + case $type in + simple) + title="$(gettext_quoted "%s")" ;; + recovery) + title="$(gettext_quoted "%s, with Linux %s (recovery mode)")" ;; + *) + title="$(gettext_quoted "%s, with Linux %s")" ;; + esac + + if [ x$type = xsimple ]; then + printf "menuentry '${title}' ${CLASS} {\n" "${os}" else - title="$(gettext_quoted "%s, with Linux %s")" + printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" fi - printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" - if ! ${recovery} ; then + + if [ x$type != xrecovery ] ; then save_default_entry | sed -e "s/^/\t/" fi @@ -114,6 +124,8 @@ done` prepare_boot_cache= +is_first_entry=true + while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` echo "Found linux image: $linux" >&2 @@ -151,12 +163,26 @@ linux_root_device_thisversion=${GRUB_DEVICE} fi - linux_entry "${OS}" "${version}" false \ + if [ x$is_first_entry = xtrue ]; then + linux_entry "${OS}" "${version}" simple \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" + + cat << EOF +submenu '$(gettext_quoted "Advanced options for ${OS}")' { +EOF + fi + + linux_entry "${OS}" "${version}" advanced \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then - linux_entry "${OS}" "${version}" true \ + linux_entry "${OS}" "${version}" recovery \ "single ${GRUB_CMDLINE_LINUX}" fi list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` + is_first_entry=false done + +if [ x$is_first_entry != xtrue ]; then #At least 1 kernel found, submenu started + echo '}' +fi