1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
From fd81fffa2d498d66dce65b50da2532690c806ea4 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@ubuntu.com>
Date: Mon, 13 Jan 2014 12:13:33 +0000
Subject: 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
---
docs/grub.texi | 5 +++++
util/grub-mkconfig.in | 7 ++++++-
util/grub.d/10_hurd.in | 4 ++--
util/grub.d/10_kfreebsd.in | 2 +-
util/grub.d/10_linux.in | 2 +-
util/grub.d/10_netbsd.in | 2 +-
util/grub.d/20_linux_xen.in | 2 +-
7 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/docs/grub.texi b/docs/grub.texi
index 0b58dafb2..86e46f33b 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -1577,6 +1577,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 fa9c53a92..0d39c8f05 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.
@@ -257,7 +261,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 3663d360e..8f6041894 100644
--- a/util/grub.d/10_hurd.in
+++ b/util/grub.d/10_hurd.in
@@ -88,8 +88,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 199b20e16..bbd63cf74 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 64204c216..f88a2de10 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -126,7 +126,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 dc0cd1b17..336895012 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 7620a14fa..64e26e4b4 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -122,7 +122,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}" "${xen_version}" "${version}")"
+ title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
else
title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
fi
|