dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0030-Don-t-write-messages-to-the-screen.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: William Jon McCann <william.jon.mccann@gmail.com>
d9d99f
Date: Wed, 15 May 2013 13:30:20 -0400
d9d99f
Subject: [PATCH] Don't write messages to the screen
d9d99f
d9d99f
Writing messages to the screen before the menus or boot splash
d9d99f
happens so quickly it looks like something is wrong and isn't
d9d99f
very appealing.
d9d99f
---
d9d99f
 grub-core/gettext/gettext.c       | 25 +++++--------------------
d9d99f
 grub-core/kern/main.c             |  5 -----
d9d99f
 grub-core/boot/i386/pc/boot.S     |  3 ---
d9d99f
 grub-core/boot/i386/pc/diskboot.S |  5 -----
d9d99f
 util/grub.d/10_linux.in           |  7 -------
d9d99f
 5 files changed, 5 insertions(+), 40 deletions(-)
d9d99f
d9d99f
diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
d9d99f
index 4880cefe3f8..b22e1bcc94b 100644
d9d99f
--- a/grub-core/gettext/gettext.c
d9d99f
+++ b/grub-core/gettext/gettext.c
d9d99f
@@ -434,16 +434,12 @@ static char *
d9d99f
 grub_gettext_env_write_lang (struct grub_env_var *var
d9d99f
 			     __attribute__ ((unused)), const char *val)
d9d99f
 {
d9d99f
-  grub_err_t err;
d9d99f
+  grub_err_t __attribute__((__unused__)) err;
d9d99f
   err = grub_gettext_init_ext (&main_context, val, grub_env_get ("locale_dir"),
d9d99f
 			       grub_env_get ("prefix"));
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
 
d9d99f
   err = grub_gettext_init_ext (&secondary_context, val,
d9d99f
 			       grub_env_get ("secondary_locale_dir"), 0);
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
 
d9d99f
   return grub_strdup (val);
d9d99f
 }
d9d99f
@@ -451,23 +447,19 @@ grub_gettext_env_write_lang (struct grub_env_var *var
d9d99f
 void
d9d99f
 grub_gettext_reread_prefix (const char *val)
d9d99f
 {
d9d99f
-  grub_err_t err;
d9d99f
+  grub_err_t __attribute__((__unused__)) err;
d9d99f
   err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), 
d9d99f
 			       grub_env_get ("locale_dir"),
d9d99f
 			       val);
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
 }
d9d99f
 
d9d99f
 static char *
d9d99f
 read_main (struct grub_env_var *var
d9d99f
 	   __attribute__ ((unused)), const char *val)
d9d99f
 {
d9d99f
-  grub_err_t err;
d9d99f
+  grub_err_t __attribute__((__unused__)) err;
d9d99f
   err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), val,
d9d99f
 			       grub_env_get ("prefix"));
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
   return grub_strdup (val);
d9d99f
 }
d9d99f
 
d9d99f
@@ -475,12 +467,9 @@ static char *
d9d99f
 read_secondary (struct grub_env_var *var
d9d99f
 		__attribute__ ((unused)), const char *val)
d9d99f
 {
d9d99f
-  grub_err_t err;
d9d99f
+  grub_err_t __attribute__((__unused__)) err;
d9d99f
   err = grub_gettext_init_ext (&secondary_context, grub_env_get ("lang"), val,
d9d99f
 			       0);
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
-
d9d99f
   return grub_strdup (val);
d9d99f
 }
d9d99f
 
d9d99f
@@ -500,18 +489,14 @@ grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)),
d9d99f
 GRUB_MOD_INIT (gettext)
d9d99f
 {
d9d99f
   const char *lang;
d9d99f
-  grub_err_t err;
d9d99f
+  grub_err_t __attribute__((__unused__)) err;
d9d99f
 
d9d99f
   lang = grub_env_get ("lang");
d9d99f
 
d9d99f
   err = grub_gettext_init_ext (&main_context, lang, grub_env_get ("locale_dir"),
d9d99f
 			       grub_env_get ("prefix"));
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
   err = grub_gettext_init_ext (&secondary_context, lang,
d9d99f
 			       grub_env_get ("secondary_locale_dir"), 0);
d9d99f
-  if (err)
d9d99f
-    grub_print_error ();
d9d99f
 
d9d99f
   grub_register_variable_hook ("locale_dir", NULL, read_main);
d9d99f
   grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary);
d9d99f
diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
d9d99f
index 8ab7794c47b..da47b18b50e 100644
d9d99f
--- a/grub-core/kern/main.c
d9d99f
+++ b/grub-core/kern/main.c
d9d99f
@@ -268,11 +268,6 @@ grub_main (void)
d9d99f
 
d9d99f
   grub_boot_time ("After machine init.");
d9d99f
 
d9d99f
-  /* Hello.  */
d9d99f
-  grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
d9d99f
-  grub_printf ("Welcome to GRUB!\n\n");
d9d99f
-  grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
d9d99f
-
d9d99f
   grub_load_config ();
d9d99f
 
d9d99f
   grub_boot_time ("Before loading embedded modules.");
d9d99f
diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S
d9d99f
index 2bd0b2d2866..ea167fe1206 100644
d9d99f
--- a/grub-core/boot/i386/pc/boot.S
d9d99f
+++ b/grub-core/boot/i386/pc/boot.S
d9d99f
@@ -249,9 +249,6 @@ real_start:
d9d99f
 	/* save drive reference first thing! */
d9d99f
 	pushw	%dx
d9d99f
 
d9d99f
-	/* print a notification message on the screen */
d9d99f
-	MSG(notification_string)
d9d99f
-
d9d99f
 	/* set %si to the disk address packet */
d9d99f
 	movw	$disk_address_packet, %si
d9d99f
 
d9d99f
diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S
d9d99f
index c1addc0df29..68d31de0c4c 100644
d9d99f
--- a/grub-core/boot/i386/pc/diskboot.S
d9d99f
+++ b/grub-core/boot/i386/pc/diskboot.S
d9d99f
@@ -50,11 +50,6 @@ _start:
d9d99f
 	/* save drive reference first thing! */
d9d99f
 	pushw	%dx
d9d99f
 
d9d99f
-	/* print a notification message on the screen */
d9d99f
-	pushw	%si
d9d99f
-	MSG(notification_string)
d9d99f
-	popw	%si
d9d99f
-
d9d99f
 	/* this sets up for the first run through "bootloop" */
d9d99f
 	movw	$LOCAL(firstlist), %di
d9d99f
 
d9d99f
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
d9d99f
index 233754ff296..3a5aa0f8dc9 100644
d9d99f
--- a/util/grub.d/10_linux.in
d9d99f
+++ b/util/grub.d/10_linux.in
d9d99f
@@ -138,27 +138,20 @@ linux_entry ()
d9d99f
     fi
d9d99f
     printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
d9d99f
   fi
d9d99f
-  message="$(gettext_printf "Loading Linux %s ..." ${version})"
d9d99f
   sed "s/^/$submenu_indentation/" << EOF
d9d99f
-	echo	'$(echo "$message" | grub_quote)'
d9d99f
 	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
d9d99f
 EOF
d9d99f
   if test -n "${initrd}" ; then
d9d99f
-    # TRANSLATORS: ramdisk isn't identifier. Should be translated.
d9d99f
-    message="$(gettext_printf "Loading initial ramdisk ...")"
d9d99f
     initrd_path=
d9d99f
     for i in ${initrd}; do
d9d99f
       initrd_path="${initrd_path} ${rel_dirname}/${i}"
d9d99f
     done
d9d99f
     sed "s/^/$submenu_indentation/" << EOF
d9d99f
-	echo	'$(echo "$message" | grub_quote)'
d9d99f
 	initrd	$(echo $initrd_path)
d9d99f
 EOF
d9d99f
   fi
d9d99f
   if test -n "${fdt}" ; then
d9d99f
-    message="$(gettext_printf "Loading fdt ...")"
d9d99f
     sed "s/^/$submenu_indentation/" << EOF
d9d99f
-	echo	'$(echo "$message" | grub_quote)'
d9d99f
 	devicetree	${rel_dirname}/${fdt}
d9d99f
 EOF
d9d99f
   fi