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