grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Hamilton <adhamilt@gmail.com>
To: grub-devel@gnu.org
Cc: daniel.kiper@oracle.com, safinaskar@zohomail.com,
	benh@debian.org, bluca@debian.org, kibi@debian.org,
	Andrew Hamilton <adhamilt@gmail.com>
Subject: [PATCH 1/3] util/grub.d/00_header.in: Disable loading all_video for EFI
Date: Wed,  5 Nov 2025 20:47:54 -0600	[thread overview]
Message-ID: <20251106024756.7050-2-adhamilt@gmail.com> (raw)
In-Reply-To: <20251106024756.7050-1-adhamilt@gmail.com>

Loading all_video for EFI can cause video issues in some cases
since bochs / cirrus may conflict with them. 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/index.php?66200

Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
---
 util/grub.d/00_header.in | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 9d36feda3..a4a516aec 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 by default to avoid conflict between
+# bochs / cirrus and EFI video. If GRUB_FORCE_EFI_ALLVIDEO is
+# set/true then defer back to all_video even for EFI.
+if [ "${GRUB_FORCE_EFI_ALLVIDEO}" = "1" ]; then
+    cat <<EOF
+  if [ x\$feature_all_video_module = xy ]; then
+EOF
+else # GRUB_FORCE_EFI_ALLVIDEO is not set true
+    cat <<EOF
+  if [ x\$grub_platform = xefi ]; then
+    insmod efi_gop
+    insmod efi_uga
+  elif [ x\$feature_all_video_module = xy ]; then
+EOF
+fi # end GRUB_FORCE_EFI_ALLVIDEO
 # If all_video.mod isn't available load all modules available
 # with versions prior to introduction of all_video.mod
 cat <<EOF
-  if [ x\$feature_all_video_module = xy ]; then
     insmod all_video
   else
     insmod efi_gop
-- 
2.43.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  reply	other threads:[~2025-11-06  2:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  2:47 [PATCH 0/3] Update 00_header to load efi video on EFI platforms Andrew Hamilton
2025-11-06  2:47 ` Andrew Hamilton [this message]
2025-11-06 13:06   ` [PATCH 1/3] util/grub.d/00_header.in: Disable loading all_video for EFI Daniel Kiper
2025-11-06  2:47 ` [PATCH 2/3] util/grub-mkconfig: Add new environment variable Andrew Hamilton
2025-11-06  2:47 ` [PATCH 3/3] docs: Document new GRUB_FORCE_EFI_ALLVIDEO variable Andrew Hamilton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251106024756.7050-2-adhamilt@gmail.com \
    --to=adhamilt@gmail.com \
    --cc=benh@debian.org \
    --cc=bluca@debian.org \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=kibi@debian.org \
    --cc=safinaskar@zohomail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).