mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-27 00:49:48 +00:00
94 lines
3.1 KiB
Diff
94 lines
3.1 KiB
Diff
Description: "single" -> "recovery" when friendly-recovery is installed
|
|
If configured with --enable-ubuntu-recovery, also set nomodeset for
|
|
recovery mode, and disable 'set gfxpayload=keep' even if the system
|
|
normally supports it. See
|
|
https://launchpad.net/ubuntu/+spec/desktop-o-xorg-tools-and-processes.
|
|
Author: Colin Watson <cjwatson@ubuntu.com>
|
|
Author: Stéphane Graber <stgraber@ubuntu.com>
|
|
Forwarded: no
|
|
Last-Update: 2013-11-26
|
|
|
|
Index: b/configure.ac
|
|
===================================================================
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -1392,6 +1392,17 @@
|
|
AC_SUBST([LIBZFS])
|
|
AC_SUBST([LIBNVPAIR])
|
|
|
|
+AC_ARG_ENABLE([ubuntu-recovery],
|
|
+ [AS_HELP_STRING([--enable-ubuntu-recovery],
|
|
+ [adjust boot options for the Ubuntu recovery mode (default=no)])],
|
|
+ [], [enable_ubuntu_recovery=no])
|
|
+if test x"$enable_ubuntu_recovery" = xyes ; then
|
|
+ UBUNTU_RECOVERY=1
|
|
+else
|
|
+ UBUNTU_RECOVERY=0
|
|
+fi
|
|
+AC_SUBST([UBUNTU_RECOVERY])
|
|
+
|
|
LIBS=""
|
|
|
|
AC_SUBST([FONT_SOURCE])
|
|
Index: b/util/grub.d/10_linux.in
|
|
===================================================================
|
|
--- a/util/grub.d/10_linux.in
|
|
+++ b/util/grub.d/10_linux.in
|
|
@@ -20,6 +20,7 @@
|
|
prefix="@prefix@"
|
|
exec_prefix="@exec_prefix@"
|
|
datarootdir="@datarootdir@"
|
|
+ubuntu_recovery="@UBUNTU_RECOVERY@"
|
|
|
|
. "@datadir@/@PACKAGE@/grub-mkconfig_lib"
|
|
|
|
@@ -78,6 +79,15 @@
|
|
|
|
title_correction_code=
|
|
|
|
+if [ -x /lib/recovery-mode/recovery-menu ]; then
|
|
+ GRUB_CMDLINE_LINUX_RECOVERY=recovery
|
|
+else
|
|
+ GRUB_CMDLINE_LINUX_RECOVERY=single
|
|
+fi
|
|
+if [ "$ubuntu_recovery" = 1 ]; then
|
|
+ GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
|
|
+fi
|
|
+
|
|
linux_entry ()
|
|
{
|
|
os="$1"
|
|
@@ -117,7 +127,9 @@
|
|
if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
|
|
echo " load_video" | sed "s/^/$submenu_indentation/"
|
|
fi
|
|
- echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
|
|
+ if [ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]; then
|
|
+ echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
|
|
+ fi
|
|
fi
|
|
|
|
echo " insmod gzio" | sed "s/^/$submenu_indentation/"
|
|
@@ -245,7 +257,7 @@
|
|
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
|
|
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
|
|
linux_entry "${OS}" "${version}" recovery \
|
|
- "single ${GRUB_CMDLINE_LINUX}"
|
|
+ "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
|
|
fi
|
|
|
|
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
|
|
Index: b/util/grub.d/30_os-prober.in
|
|
===================================================================
|
|
--- a/util/grub.d/30_os-prober.in
|
|
+++ b/util/grub.d/30_os-prober.in
|
|
@@ -213,7 +213,7 @@
|
|
fi
|
|
|
|
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
|
|
- recovery_params="$(echo "${LPARAMS}" | grep single)" || true
|
|
+ recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
|
|
counter=1
|
|
while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
|
|
counter=$((counter+1));
|