From 7fd40157778bf9021ea8228b6a87520b2e8bc926 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 Subject: [PATCH 65/74] Make grub2-mkconfig construct titles that look like the ones we want elsewhere. Resolves: rhbz#1215839 Signed-off-by: Peter Jones --- util/grub.d/10_linux.in | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 358dd67..1f5899f 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -66,6 +66,15 @@ case x"$GRUB_FS" in ;; esac +mktitle () +{ + local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})" + local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})" + + local titlestr="${OS_NAME} (%s) ${OS_VERS}" + echo -n ${titlestr} +} + title_correction_code= linux_entry () @@ -96,15 +105,14 @@ linux_entry () if [ x$type != xsimple ] ; then case $type in recovery) - title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;; + title="$(printf "$(mktitle) (recovery mode)" "${version}")" ;; *) - title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;; + title="$(printf "$(mktitle)" "${version}")" ;; esac 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 -- 2.4.3