1 From 397ab153295533147505cbe40f49f648e73a0ae8 Mon Sep 17 00:00:00 2001
2 From: Colin Watson <cjwatson@ubuntu.com>
3 Date: Mon, 13 Jan 2014 12:13:06 +0000
4 Subject: "single" -> "recovery" when friendly-recovery is installed
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 If configured with --enable-ubuntu-recovery, also set nomodeset for
10 recovery mode, and disable 'set gfxpayload=keep' even if the system
11 normally supports it. See
12 https://launchpad.net/ubuntu/+spec/desktop-o-xorg-tools-and-processes.
14 Author: Stéphane Graber <stgraber@ubuntu.com>
16 Last-Update: 2013-12-25
18 Patch-Name: mkconfig-ubuntu-recovery.patch
20 configure.ac | 11 +++++++++++
21 util/grub.d/10_linux.in | 16 ++++++++++++++--
22 util/grub.d/30_os-prober.in | 2 +-
23 3 files changed, 26 insertions(+), 3 deletions(-)
25 diff --git a/configure.ac b/configure.ac
26 index 08b518fcc..47102bfb5 100644
29 @@ -1846,6 +1846,17 @@ fi
33 +AC_ARG_ENABLE([ubuntu-recovery],
34 + [AS_HELP_STRING([--enable-ubuntu-recovery],
35 + [adjust boot options for the Ubuntu recovery mode (default=no)])],
36 + [], [enable_ubuntu_recovery=no])
37 +if test x"$enable_ubuntu_recovery" = xyes ; then
42 +AC_SUBST([UBUNTU_RECOVERY])
46 AC_SUBST([FONT_SOURCE])
47 diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
48 index 8c22c79f6..0509ac680 100644
49 --- a/util/grub.d/10_linux.in
50 +++ b/util/grub.d/10_linux.in
51 @@ -20,6 +20,7 @@ set -e
53 exec_prefix="@exec_prefix@"
54 datarootdir="@datarootdir@"
55 +ubuntu_recovery="@UBUNTU_RECOVERY@"
57 . "$pkgdatadir/grub-mkconfig_lib"
59 @@ -84,6 +85,15 @@ esac
61 title_correction_code=
63 +if [ -x /lib/recovery-mode/recovery-menu ]; then
64 + GRUB_CMDLINE_LINUX_RECOVERY=recovery
66 + GRUB_CMDLINE_LINUX_RECOVERY=single
68 +if [ "$ubuntu_recovery" = 1 ]; then
69 + GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
75 @@ -123,7 +133,9 @@ linux_entry ()
76 if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
77 echo " load_video" | sed "s/^/$submenu_indentation/"
79 - echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
80 + if [ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]; then
81 + echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
85 echo " insmod gzio" | sed "s/^/$submenu_indentation/"
86 @@ -280,7 +292,7 @@ while [ "x$list" != "x" ] ; do
87 "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
88 if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
89 linux_entry "${OS}" "${version}" recovery \
90 - "single ${GRUB_CMDLINE_LINUX}"
91 + "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
94 list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
95 diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
96 index 515a68c7a..775ceb2e0 100644
97 --- a/util/grub.d/30_os-prober.in
98 +++ b/util/grub.d/30_os-prober.in
99 @@ -220,7 +220,7 @@ EOF
102 onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
103 - recovery_params="$(echo "${LPARAMS}" | grep single)" || true
104 + recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
106 while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
107 counter=$((counter+1));