nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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