From: Andrew Hamilton Date: Fri, 7 Nov 2025 00:24:33 +0000 (-0600) Subject: util/grub.d/00_header.in: Disable loading all_video for EFI X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea0b76dc4a003f2b7f828ef0c24cc8227148b2f8;p=thirdparty%2Fgrub.git util/grub.d/00_header.in: Disable loading all_video for EFI Loading all_video for EFI can cause video issues in some cases since GRUB Bochs/Cirrus drivers may conflict with native EFI drivers. Change default behavior for EFI to only load EFI specific video modules. Also include a new environment variable to restore the old behavior if needed. Fixes: https://savannah.gnu.org/bugs/?66200 Signed-off-by: Andrew Hamilton Reviewed-by: Daniel Kiper --- diff --git a/docs/grub.texi b/docs/grub.texi index cd4631aa3..d4287181c 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1642,6 +1642,13 @@ This option is unset by default, and is deprecated in favour of the less confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or @samp{GRUB_TIMEOUT_STYLE=hidden}. +@item GRUB_FORCE_EFI_ALL_VIDEO +When set to true, this will allow grub-mkconfig to generate a GRUB config +that supports loading the all_video module on the EFI platform instead of +just the efi_gop and efi_uga modules. + +This option is unset by default. + @end table For more detailed customisation of @command{grub-mkconfig}'s output, you may diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 32c480dae..45787a1d1 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -255,7 +255,8 @@ export GRUB_DEFAULT \ GRUB_ENABLE_CRYPTODISK \ GRUB_BADRAM \ GRUB_OS_PROBER_SKIP_LIST \ - GRUB_DISABLE_SUBMENU + GRUB_DISABLE_SUBMENU \ + GRUB_FORCE_EFI_ALL_VIDEO if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 9d36feda3..77834cfaf 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -124,10 +124,24 @@ if [ -n "${GRUB_VIDEO_BACKEND}" ]; then insmod ${GRUB_VIDEO_BACKEND} EOF else +# For EFI, use EFI video drivers only by default to avoid conflict between +# GRUB Bochs/Cirrus and native EFI drivers. If GRUB_FORCE_EFI_ALL_VIDEO is +# set/true then defer back to all_video even for EFI. +if [ "${GRUB_FORCE_EFI_ALL_VIDEO}" = "1" ]; then + cat <