Hi,

This patch moves the screen init code from reader to menu, so that
hidemenu would work as before. A minor side effect is that if grub.cfg
is not found, the "GNU GRUB" header would not be printed, but I guess
this is not an issue.

-- 
Bean
diff --git a/kern/rescue_reader.c b/kern/rescue_reader.c
index 2a06f3f..0b738d1 100644
--- a/kern/rescue_reader.c
+++ b/kern/rescue_reader.c
@@ -26,13 +26,6 @@
 
 static char linebuf[GRUB_RESCUE_BUF_SIZE];
 
-static grub_err_t
-grub_rescue_init (void)
-{
-  grub_printf ("Entering rescue mode...\n");
-  return 0;
-}
-
 /* Prompt to input a command and read the line.  */
 static grub_err_t
 grub_rescue_read_line (char **line, int cont)
@@ -77,7 +70,6 @@ grub_rescue_read_line (char **line, int cont)
 static struct grub_reader grub_rescue_reader =
   {
     .name = "rescue",
-    .init = grub_rescue_init,
     .read_line = grub_rescue_read_line
   };
 
diff --git a/normal/main.c b/normal/main.c
index 7f6336e..84e25f9 100644
--- a/normal/main.c
+++ b/normal/main.c
@@ -474,14 +474,7 @@ grub_cmdline_run (int nested)
   grub_reader_t reader = grub_reader_get_current ();
 
   reader_nested = nested;
-  if (reader->init)
-    reader->init ();
-  grub_reader_loop (0);
-}
 
-static grub_err_t
-grub_normal_reader_init (void)
-{
   grub_normal_init_page ();
   grub_setcursor (1);
 
@@ -491,7 +484,7 @@ grub_normal_reader_init (void)
    device/file completions.%s ]\n\n",
 	       reader_nested ? " ESC at any time exits." : "");
 
-  return 0;
+  grub_reader_loop (0);
 }
 
 static char cmdline[GRUB_MAX_CMDLINE];
@@ -524,7 +517,6 @@ grub_normal_read_line (char **line, int cont)
 static struct grub_reader grub_normal_reader =
   {
     .name = "normal",
-    .init = grub_normal_reader_init,
     .read_line = grub_normal_read_line
   };
 
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to