]> git.proxmox.com Git - grub2.git/blob - debian/patches/mkconfig-ubuntu-recovery.patch
New upstream release candidate (2.04~rc1)
[grub2.git] / debian / patches / mkconfig-ubuntu-recovery.patch
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
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
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.
13
14 Author: Stéphane Graber <stgraber@ubuntu.com>
15 Forwarded: no
16 Last-Update: 2013-12-25
17
18 Patch-Name: mkconfig-ubuntu-recovery.patch
19 ---
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(-)
24
25 diff --git a/configure.ac b/configure.ac
26 index 08b518fcc..47102bfb5 100644
27 --- a/configure.ac
28 +++ b/configure.ac
29 @@ -1846,6 +1846,17 @@ fi
30 AC_SUBST([LIBZFS])
31 AC_SUBST([LIBNVPAIR])
32
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
38 + UBUNTU_RECOVERY=1
39 +else
40 + UBUNTU_RECOVERY=0
41 +fi
42 +AC_SUBST([UBUNTU_RECOVERY])
43 +
44 LIBS=""
45
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
52 prefix="@prefix@"
53 exec_prefix="@exec_prefix@"
54 datarootdir="@datarootdir@"
55 +ubuntu_recovery="@UBUNTU_RECOVERY@"
56
57 . "$pkgdatadir/grub-mkconfig_lib"
58
59 @@ -84,6 +85,15 @@ esac
60
61 title_correction_code=
62
63 +if [ -x /lib/recovery-mode/recovery-menu ]; then
64 + GRUB_CMDLINE_LINUX_RECOVERY=recovery
65 +else
66 + GRUB_CMDLINE_LINUX_RECOVERY=single
67 +fi
68 +if [ "$ubuntu_recovery" = 1 ]; then
69 + GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
70 +fi
71 +
72 linux_entry ()
73 {
74 os="$1"
75 @@ -123,7 +133,9 @@ linux_entry ()
76 if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
77 echo " load_video" | sed "s/^/$submenu_indentation/"
78 fi
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/"
82 + fi
83 fi
84
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}"
92 fi
93
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
100 fi
101
102 onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
103 - recovery_params="$(echo "${LPARAMS}" | grep single)" || true
104 + recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
105 counter=1
106 while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
107 counter=$((counter+1));