8a74d28
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8a74d28
From: Hans de Goede <hdegoede@redhat.com>
8a74d28
Date: Fri, 28 Jan 2022 11:30:33 +0100
8a74d28
Subject: [PATCH] EFI: suppress the "Welcome to GRUB!" message in EFI builds
8a74d28
8a74d28
Grub EFI builds are now often used in combination with flicker-free
8a74d28
boot, but this breaks with upstream grub because the "Welcome to GRUB!"
8a74d28
message will kick the EFI fb into text mode and show the msg,
8a74d28
breaking the flicker-free experience.
8a74d28
8a74d28
EFI systems are so fast, that when the menu or the countdown are enabled
8a74d28
the message will be immediately overwritten, so in these cases not
8a74d28
printing the message does not matter.
8a74d28
8a74d28
And in case when the timeout_style is set to TIMEOUT_STYLE_HIDDEN,
8a74d28
the user has asked grub to be quiet (for example to allow flickfree
8a74d28
boot) annd thus the message should not be printed.
8a74d28
8a74d28
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8a74d28
---
8a74d28
 grub-core/kern/main.c | 3 +++
8a74d28
 1 file changed, 3 insertions(+)
8a74d28
8a74d28
diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
e622855
index 3fc3401472..993b8a8598 100644
8a74d28
--- a/grub-core/kern/main.c
8a74d28
+++ b/grub-core/kern/main.c
8a74d28
@@ -317,10 +317,13 @@ grub_main (void)
8a74d28
 
8a74d28
   grub_boot_time ("After machine init.");
8a74d28
 
8a74d28
+  /* This breaks flicker-free boot on EFI systems, so disable it there. */
8a74d28
+#ifndef GRUB_MACHINE_EFI
8a74d28
   /* Hello.  */
8a74d28
   grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
8a74d28
   grub_printf ("Welcome to GRUB!\n\n");
8a74d28
   grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
8a74d28
+#endif
8a74d28
 
8a74d28
   /* Init verifiers API. */
8a74d28
   grub_verifiers_init ();