9d15b4d
From b6e3ffe7ae7e4222cc15876cb72c691112f3c4b0 Mon Sep 17 00:00:00 2001
f4c76c0
From: Peter Jones <pjones@redhat.com>
f4c76c0
Date: Tue, 28 Apr 2015 11:15:03 -0400
1b23a22
Subject: [PATCH 63/90] Make grub2-mkconfig construct titles that look like the
f4c76c0
 ones we want elsewhere.
f4c76c0
f4c76c0
Resolves: rhbz#1215839
f4c76c0
f4c76c0
Signed-off-by: Peter Jones <pjones@redhat.com>
f4c76c0
---
f4c76c0
 util/grub.d/10_linux.in | 14 +++++++++++---
f4c76c0
 1 file changed, 11 insertions(+), 3 deletions(-)
f4c76c0
f4c76c0
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
0ac23e2
index c662726..1215241 100644
f4c76c0
--- a/util/grub.d/10_linux.in
f4c76c0
+++ b/util/grub.d/10_linux.in
b9efc54
@@ -68,6 +68,15 @@ case x"$GRUB_FS" in
f4c76c0
 	;;
f4c76c0
 esac
f4c76c0
 
f4c76c0
+mktitle ()
f4c76c0
+{
f4c76c0
+  local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
f4c76c0
+  local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
f4c76c0
+
f4c76c0
+  local titlestr="${OS_NAME} (%s) ${OS_VERS}"
f4c76c0
+  echo -n ${titlestr}
f4c76c0
+}
f4c76c0
+
f4c76c0
 title_correction_code=
f4c76c0
 
f4c76c0
 linux_entry ()
b9efc54
@@ -98,15 +107,14 @@ linux_entry ()
f4c76c0
   if [ x$type != xsimple ] ; then
f4c76c0
       case $type in
f4c76c0
 	  recovery)
f4c76c0
-	      title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
f4c76c0
+	      title="$(printf "$(mktitle) (recovery mode)" "${version}")" ;;
f4c76c0
 	  *)
f4c76c0
-	      title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
f4c76c0
+	      title="$(printf "$(mktitle)" "${version}")" ;;
f4c76c0
       esac
f4c76c0
       if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
f4c76c0
 	  replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
f4c76c0
 	  quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
f4c76c0
 	  title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
f4c76c0
-	  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")"
f4c76c0
       fi
f4c76c0
       echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
f4c76c0
   else
f4c76c0
-- 
7ec92ff
2.9.3
f4c76c0