2018-04-11 18:42:03 +00:00
From c7ae420d095ccec20481c25b14773ab2fce658b5 Mon Sep 17 00:00:00 2001
2015-04-28 15:20:32 +00:00
From: Peter Jones <pjones@redhat.com>
Date: Tue, 28 Apr 2015 11:15:03 -0400
2018-06-04 16:28:07 +00:00
Subject: [PATCH 128/243] Make grub2-mkconfig construct titles that look like
2017-06-16 19:31:32 +00:00
the ones we want elsewhere.
2015-04-28 15:20:32 +00:00
Resolves: rhbz#1215839
Signed-off-by: Peter Jones <pjones@redhat.com>
---
2018-01-17 22:04:09 +00:00
util/grub.d/10_linux.in | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
2015-04-28 15:20:32 +00:00
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
2018-02-27 18:56:41 +00:00
index c6627268cca..1215241859b 100644
2015-04-28 15:20:32 +00:00
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
2018-01-17 22:04:09 +00:00
@@ -68,6 +68,15 @@ case x"$GRUB_FS" in
2015-04-28 15:20:32 +00:00
;;
esac
+mktitle ()
+{
2018-01-17 22:04:09 +00:00
+ local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
+ local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
2015-04-28 15:20:32 +00:00
+
2018-01-17 22:04:09 +00:00
+ local titlestr="${OS_NAME} (%s) ${OS_VERS}"
+ echo -n ${titlestr}
2015-04-28 15:20:32 +00:00
+}
+
title_correction_code=
linux_entry ()
2018-01-17 22:04:09 +00:00
@@ -98,15 +107,14 @@ linux_entry ()
2015-04-28 15:20:32 +00:00
if [ x$type != xsimple ] ; then
2018-01-17 22:04:09 +00:00
case $type in
recovery)
2015-04-28 15:20:32 +00:00
- title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
2018-01-17 22:04:09 +00:00
+ title="$(printf "$(mktitle) (recovery mode)" "${version}")" ;;
*)
2015-04-28 15:20:32 +00:00
- title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
2018-01-17 22:04:09 +00:00
+ title="$(printf "$(mktitle)" "${version}")" ;;
esac
2015-04-28 15:20:32 +00:00
if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
- 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")"
fi
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
--
2018-06-04 16:28:07 +00:00
2.17.1
2015-04-28 15:20:32 +00:00