summaryrefslogtreecommitdiff
path: root/util/grub.d
diff options
context:
space:
mode:
authorEvan Broder <evan@ebroder.net>2014-01-13 12:13:29 +0000
committerColin Watson <cjwatson@debian.org>2020-03-07 12:21:23 +0000
commitf892ba14f3ec78b03cd3feb2f5845a223786823f (patch)
treed027ba99af16edb713e76a08de4c5a502b9ea8b6 /util/grub.d
parentbe1a470babffb9305a41aae735cc62c509d63b27 (diff)
Add configure option to enable gfxpayload=keep dynamically
Set GRUB_GFXPAYLOAD_LINUX=keep unless it's known to be unsupported on the current hardware. See https://blueprints.launchpad.net/ubuntu/+spec/packageselection-foundations-n-grub2-boot-framebuffer. Author: Colin Watson <cjwatson@ubuntu.com> Forwarded: no Last-Update: 2019-05-25 Patch-Name: gfxpayload-dynamic.patch
Diffstat (limited to 'util/grub.d')
-rw-r--r--util/grub.d/10_linux.in37
1 files changed, 34 insertions, 3 deletions
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 51cdb5e1d..2f5217358 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -23,6 +23,7 @@ datarootdir="@datarootdir@"
ubuntu_recovery="@UBUNTU_RECOVERY@"
quiet_boot="@QUIET_BOOT@"
quick_boot="@QUICK_BOOT@"
+gfxpayload_dynamic="@GFXPAYLOAD_DYNAMIC@"
. "$pkgdatadir/grub-mkconfig_lib"
@@ -145,9 +146,10 @@ linux_entry ()
if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
echo " load_video" | sed "s/^/$submenu_indentation/"
fi
- if [ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]; then
- echo " set gfxpayload=$GRUB_GFXPAYLOAD_LINUX" | sed "s/^/$submenu_indentation/"
- fi
+ fi
+ if ([ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]) && \
+ ([ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 1 ]); then
+ echo " set gfxpayload=\$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
fi
echo " insmod gzio" | sed "s/^/$submenu_indentation/"
@@ -226,6 +228,35 @@ prepare_root_cache=
boot_device_id=
title_correction_code=
+# Use ELILO's generic "efifb" when it's known to be available.
+# FIXME: We need an interface to select vesafb in case efifb can't be used.
+if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 0 ]; then
+ echo "set linux_gfx_mode=$GRUB_GFXPAYLOAD_LINUX"
+else
+ cat << EOF
+if [ "\${recordfail}" != 1 ]; then
+ if [ -e \${prefix}/gfxblacklist.txt ]; then
+ if hwmatch \${prefix}/gfxblacklist.txt 3; then
+ if [ \${match} = 0 ]; then
+ set linux_gfx_mode=keep
+ else
+ set linux_gfx_mode=text
+ fi
+ else
+ set linux_gfx_mode=text
+ fi
+ else
+ set linux_gfx_mode=keep
+ fi
+else
+ set linux_gfx_mode=text
+fi
+EOF
+fi
+cat << EOF
+export linux_gfx_mode
+EOF
+
# Extra indentation to add to menu entries in a submenu. We're not in a submenu
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""