]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-11-12 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Tue, 11 Nov 2008 23:16:54 +0000 (23:16 +0000)
committerrobertmh <robertmh@localhost>
Tue, 11 Nov 2008 23:16:54 +0000 (23:16 +0000)
        Fix a regression introduced by the at_keyboard.mod split.  Because
        some terminals are default on some platforms and non-default on
        others, the first terminal being registered determines which is
        going to be default.

        * kern/term.c (grub_term_register_input): If this is the first
        terminal being registered, set it as the current one.
        (grub_term_register_output): Likewise.

        * term/efi/console.c (grub_console_init): Do not call
        grub_term_set_current_output() or grub_term_set_current_input().
        * term/ieee1275/ofconsole.c (grub_console_init): Likewise.
        * term/i386/pc/console.c (grub_console_init): Likewise.
        (grub_console_fini): Do not call grub_term_set_current_input()
        (but leave grub_term_set_current_output() to restore text mode).

ChangeLog
kern/term.c
term/efi/console.c
term/i386/pc/console.c
term/ieee1275/ofconsole.c

index 38d4a88eb29e497170878ee87c6dc52b23bb777d..33e70ec89f38983228462e49311a988fe6cee015 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2008-11-12  Robert Millan  <rmh@aybabtu.com>
+
+       Fix a regression introduced by the at_keyboard.mod split.  Because
+       some terminals are default on some platforms and non-default on
+       others, the first terminal being registered determines which is
+       going to be default.
+
+       * kern/term.c (grub_term_register_input): If this is the first
+       terminal being registered, set it as the current one.
+       (grub_term_register_output): Likewise.
+
+       * term/efi/console.c (grub_console_init): Do not call
+       grub_term_set_current_output() or grub_term_set_current_input().
+       * term/ieee1275/ofconsole.c (grub_console_init): Likewise.
+       * term/i386/pc/console.c (grub_console_init): Likewise.
+       (grub_console_fini): Do not call grub_term_set_current_input()
+       (but leave grub_term_set_current_output() to restore text mode).
+
 2008-11-10  Robert Millan  <rmh@aybabtu.com>
 
        * util/grub.d/00_header.in: Add backward compatibility check for
index 24324c203b034459cac3acdb587ddc122301b6b1..2acfdae7278775a0a1415ec8d34651abfe5e4e51 100644 (file)
@@ -44,6 +44,8 @@ grub_term_register_input (grub_term_input_t term)
 {
   term->next = grub_term_list_input;
   grub_term_list_input = term;
+  if (! grub_cur_term_input)
+    grub_term_set_current_input (term);
 }
 
 void
@@ -51,6 +53,8 @@ grub_term_register_output (grub_term_output_t term)
 {
   term->next = grub_term_list_output;
   grub_term_list_output = term;
+  if (! grub_cur_term_output)
+    grub_term_set_current_output (term);
 }
 
 void
index 33d404f2614b446d671f854a91f8534c3640def4..ff842c0f3f90eddf1dd7fa3a0e3d872b9a230427 100644 (file)
@@ -368,8 +368,6 @@ grub_console_init (void)
 
   grub_term_register_input (&grub_console_term_input);
   grub_term_register_output (&grub_console_term_output);
-  grub_term_set_current_output (&grub_console_term_output);
-  grub_term_set_current_input (&grub_console_term_input);
 }
 
 void
index 6105ac7d89e06ed083bd00c8fed61eaf2b082696..7c151281327950d43eea52807059b3135965cccd 100644 (file)
@@ -156,19 +156,19 @@ void
 grub_console_init (void)
 {
   grub_term_register_output (&grub_console_term_output);
-  grub_term_set_current_output (&grub_console_term_output);
 #ifdef GRUB_MACHINE_PCBIOS
   grub_term_register_input (&grub_console_term_input);
-  grub_term_set_current_input (&grub_console_term_input);
 #endif
 }
 
 void
 grub_console_fini (void)
 {
+  /* This is to make sure the console is restored to text mode before
+     we boot.  */
   grub_term_set_current_output (&grub_console_term_output);
+
 #ifdef GRUB_MACHINE_PCBIOS
-  grub_term_set_current_input (&grub_console_term_input);
   grub_term_unregister_input (&grub_console_term_input);
 #endif
   grub_term_unregister_output (&grub_console_term_output);
index cec227ae46fa83bc2ea247db08b7a8dd63611ecf..70fda9ab43253e524c5e86c6124ee5eeb3afe027 100644 (file)
@@ -422,8 +422,6 @@ grub_console_init (void)
 {
   grub_term_register_input (&grub_ofconsole_term_input);
   grub_term_register_output (&grub_ofconsole_term_output);
-  grub_term_set_current_output (&grub_ofconsole_term_output);
-  grub_term_set_current_input (&grub_ofconsole_term_input);
 }
 
 void