From: Colin Watson Date: Mon, 13 Jan 2014 12:13:33 +0000 (+0000) Subject: Add GRUB_RECOVERY_TITLE option X-Git-Tag: archive/raspbian/2.14_git20250718.0e36779-2+rpi1^2~52 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8fe624dc6d07293a491366ed06625417f5b47f61;p=grub2.git Add GRUB_RECOVERY_TITLE option This allows the controversial "recovery mode" text to be customised. Bug-Ubuntu: https://bugs.launchpad.net/bugs/1240360 Forwarded: no Last-Update: 2013-12-25 Patch-Name: mkconfig-recovery-title.patch Gbp-Pq: Name mkconfig-recovery-title.patch --- diff --git a/docs/grub.texi b/docs/grub.texi index 1a67293..00bf798 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1618,6 +1618,11 @@ a console is restricted or limited. This option is only effective when GRUB was configured with the @option{--enable-quick-boot} option. +@item GRUB_RECOVERY_TITLE +This option sets the English text of the string that will be displayed in +parentheses to indicate that a boot option is provided to help users recover +a broken system. The default is "recovery mode". + @end table The following options are still accepted for compatibility with existing diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 0ecf2a7..13e436b 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -201,6 +201,10 @@ GRUB_ACTUAL_DEFAULT="$GRUB_DEFAULT" if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'`" ; fi +if [ "x${GRUB_RECOVERY_TITLE}" = "x" ]; then + GRUB_RECOVERY_TITLE="recovery mode" +fi + # These are defined in this script, export them here so that user can # override them. @@ -261,7 +265,8 @@ export GRUB_DEFAULT \ GRUB_BADRAM \ GRUB_OS_PROBER_SKIP_LIST \ GRUB_DISABLE_SUBMENU \ - GRUB_RECORDFAIL_TIMEOUT + GRUB_RECORDFAIL_TIMEOUT \ + GRUB_RECOVERY_TITLE if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index f9c394e..718eee9 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -113,8 +113,8 @@ hurd_entry () { if [ x$type != xsimple ] ; then if [ x$type = xrecovery ] ; then - title="$(gettext_printf "%s, with Hurd %s (recovery mode)" "${OS}" "${kernel_base}")" - oldtitle="$OS using $kernel_base (recovery mode)" + title="$(gettext_printf "%s, with Hurd %s (%s)" "${OS}" "${kernel_base}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" + oldtitle="$OS using $kernel_base ($GRUB_RECOVERY_TITLE)" else title="$(gettext_printf "%s, with Hurd %s" "${OS}" "${kernel_base}")" oldtitle="$OS using $kernel_base" diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in index 83e9636..1431673 100644 --- a/util/grub.d/10_kfreebsd.in +++ b/util/grub.d/10_kfreebsd.in @@ -76,7 +76,7 @@ kfreebsd_entry () fi if [ x$type != xsimple ] ; then if [ x$type = xrecovery ] ; then - title="$(gettext_printf "%s, with kFreeBSD %s (recovery mode)" "${os}" "${version}")" + title="$(gettext_printf "%s, with kFreeBSD %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" else title="$(gettext_printf "%s, with kFreeBSD %s" "${os}" "${version}")" fi diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index c1b1c29..3249dd2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -122,7 +122,7 @@ linux_entry () if [ x$type != xsimple ] ; then case $type in recovery) - title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;; + title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" ;; *) title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;; esac diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in index 3154e9e..a377f4b 100644 --- a/util/grub.d/10_netbsd.in +++ b/util/grub.d/10_netbsd.in @@ -102,7 +102,7 @@ netbsd_entry () if [ x$type != xsimple ] ; then if [ x$type = xrecovery ] ; then - title="$(gettext_printf "%s, with kernel %s (via %s, recovery mode)" "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}")" + title="$(gettext_printf "%s, with kernel %s (via %s, %s)" "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" else title="$(gettext_printf "%s, with kernel %s (via %s)" "${OS}" "$(echo ${kernel} | sed -e 's,^.*/,,')" "${loader}")" fi diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 94dd8be..5c93c99 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -120,7 +120,7 @@ linux_entry_xsm () fi if [ x$type != xsimple ] ; then if [ x$type = xrecovery ] ; then - title="$(gettext_printf "%s, with Xen %s and Linux %s (recovery mode)" "${os}" "${entry_xen_version}" "${version}")" + title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${entry_xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" else title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${entry_xen_version}" "${version}")" fi