Add GRUB_RECOVERY_TITLE option
authorColin Watson <cjwatson@ubuntu.com>
Mon, 13 Jan 2014 12:13:33 +0000 (12:13 +0000)
committerJulian Andres Klode <jak@debian.org>
Sun, 2 Nov 2025 11:08:11 +0000 (12:08 +0100)
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

docs/grub.texi
util/grub-mkconfig.in
util/grub.d/10_hurd.in
util/grub.d/10_kfreebsd.in
util/grub.d/10_linux.in
util/grub.d/10_netbsd.in
util/grub.d/20_linux_xen.in

index 1a67293bc8af1d89f98cd35b99319c14d066054d..00bf79835013b0ae359c529f105baad45c1926d3 100644 (file)
@@ -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
index 0ecf2a730208146f534939f2e7c06f0e11b55a69..13e436b6b8d560fa60fc9ad90fba4f5205457812 100644 (file)
@@ -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"
index f9c394ecb1c824e934970f870cb7649de1889e54..718eee95cb5d8c029bcb2bf4a903a2947aa25696 100644 (file)
@@ -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"
index 83e9636e83eacc4f0112a2c1c40ea71f984816c8..143167375ce8ce5bf660074ac0b13cdeeee61b3a 100644 (file)
@@ -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
index c1b1c291585b338466bf814a48a82c78d90f913a..3249dd287f0793d427b721ce62031db350e72f22 100644 (file)
@@ -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
index 3154e9e1568fde414924cba97e1701dca8d2eec7..a377f4b9eb8544a93c85404ea4e05cfbe3c760c6 100644 (file)
@@ -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
index 94dd8be1342aaa68fd35eeede20c79b7c5e9548c..5c93c995f1e0a853fd76e263057fe0a08908a492 100644 (file)
@@ -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