c78952
From c7ae420d095ccec20481c25b14773ab2fce658b5 Mon Sep 17 00:00:00 2001
6f1e3d
From: Peter Jones <pjones@redhat.com>
6f1e3d
Date: Tue, 28 Apr 2015 11:15:03 -0400
31cddd
Subject: [PATCH] Make grub2-mkconfig construct titles that look like
6f1e3d
 the ones we want elsewhere.
6f1e3d
6f1e3d
Resolves: rhbz#1215839
6f1e3d
6f1e3d
Signed-off-by: Peter Jones <pjones@redhat.com>
6f1e3d
---
6f1e3d
 util/grub.d/10_linux.in | 14 +++++++++++---
6f1e3d
 1 file changed, 11 insertions(+), 3 deletions(-)
6f1e3d
6f1e3d
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
ec4acb
index c6627268cca..1215241859b 100644
6f1e3d
--- a/util/grub.d/10_linux.in
6f1e3d
+++ b/util/grub.d/10_linux.in
6f1e3d
@@ -68,6 +68,15 @@ case x"$GRUB_FS" in
6f1e3d
 	;;
6f1e3d
 esac
6f1e3d
 
6f1e3d
+mktitle ()
6f1e3d
+{
6f1e3d
+  local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
6f1e3d
+  local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
6f1e3d
+
6f1e3d
+  local titlestr="${OS_NAME} (%s) ${OS_VERS}"
6f1e3d
+  echo -n ${titlestr}
6f1e3d
+}
6f1e3d
+
6f1e3d
 title_correction_code=
6f1e3d
 
6f1e3d
 linux_entry ()
6f1e3d
@@ -98,15 +107,14 @@ linux_entry ()
6f1e3d
   if [ x$type != xsimple ] ; then
6f1e3d
       case $type in
6f1e3d
 	  recovery)
6f1e3d
-	      title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
6f1e3d
+	      title="$(printf "$(mktitle) (recovery mode)" "${version}")" ;;
6f1e3d
 	  *)
6f1e3d
-	      title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
6f1e3d
+	      title="$(printf "$(mktitle)" "${version}")" ;;
6f1e3d
       esac
6f1e3d
       if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
6f1e3d
 	  replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
6f1e3d
 	  quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
6f1e3d
 	  title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
6f1e3d
-	  grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
6f1e3d
       fi
6f1e3d
       echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
6f1e3d
   else