From bd9abb21c59118a8c94a3fa63a3aefd94914bca4 Mon Sep 17 00:00:00 2001 From: okuji Date: Mon, 29 Apr 2002 00:35:30 +0000 Subject: [PATCH] 2002-04-29 Yoshinori K. Okuji * stage2/builtins.c [SUPPORT_SERIAL] (terminal_func): Added a new option ``--silent''. This suppresses messages, if specified. --- ChangeLog | 5 +++++ NEWS | 2 ++ THANKS | 1 + docs/grub.texi | 17 ++++++++++------- docs/stamp-vti | 2 +- docs/version.texi | 2 +- stage2/builtins.c | 10 ++++++++-- 7 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4628ad0c6..582f40f8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-04-29 Yoshinori K. Okuji + + * stage2/builtins.c [SUPPORT_SERIAL] (terminal_func): Added a + new option ``--silent''. This suppresses messages, if specified. + 2002-04-29 Yoshinori K. Okuji * config.guess: New upstream version. diff --git a/NEWS b/NEWS index b92ec73cf..a3d544c7c 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ New in 0.92: * The command "terminal" accepts a new option, "--lines=LINES". You can set the maximum number of lines arbitrarily with this option. If you don't specify it, the maximum number will be 24. +* The command "terminal" accepts another new option, "--silent". You can + suppress the "Press any key to continue" message with this option. * The mem= option for Linux is recognized and used to limit the maximum address of initrd. * A fallback entry is executed immediately after a default entry, diff --git a/THANKS b/THANKS index f380d4e9f..dd555b2e7 100644 --- a/THANKS +++ b/THANKS @@ -38,6 +38,7 @@ Hal Snyder HASEGAWA Tomoki Heikki Vatiainen Heiko Schroeder +Henrik Nordstrom Herbert Nachtnebel Hisazumi Kenji HORIKAWA Kazunori diff --git a/docs/grub.texi b/docs/grub.texi index 29c9faa88..216e25252 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -186,10 +186,10 @@ FreeBSD boot loader, and so GRUB was born. Erich added many features to GRUB, but other priorities prevented him from keeping up with the demands of its quickly-expanding user base. In -1999, Gordon Matzigkeit and OKUJI Yoshinori adopted GRUB as an official -GNU package, and opened its development by making the latest sources -available via anonymous CVS. @xref{Obtaining and Building GRUB}, for -more information. +1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an +official GNU package, and opened its development by making the latest +sources available via anonymous CVS. @xref{Obtaining and Building +GRUB}, for more information. @node Features @@ -2274,7 +2274,7 @@ character each of the symbols corresponds: @node terminal @subsection terminal -@deffn Command terminal [@option{--dumb}] [@option{--timeout=secs}] [@option{--lines=lines}] [@option{console}] [@option{serial}] [@option{hercules}] +@deffn Command terminal [@option{--dumb}] [@option{--timeout=secs}] [@option{--lines=lines}] [@option{--silent}] [@option{console}] [@option{serial}] [@option{hercules}] Select a terminal for user interaction. The terminal is assumed to be VT100-compatible unless @option{--dumb} is specified. If both @option{console} and @option{serial} are specified, then GRUB will use @@ -2291,6 +2291,9 @@ and the usage is quite similar to that for serial terminals: specify The option @option{--lines} defines the number of lines in your terminal, and it is used for the internal pager function. If you don't specify this option, the number is assumed as 24. + +The option @option{--silent} suppresses the message to prompt you to +hit any key. This might be useful if your system has no terminal device. @end deffn @@ -3417,8 +3420,8 @@ Suppress all normal output. @item How does GNU GRUB differ from Erich's original GRUB? GNU GRUB is the successor of Erich's great GRUB. He couldn't work on -GRUB because of some other tasks, so the current maintainers OKUJI -Yoshinori and Gordon Matzigkeit took over the maintainership, and opened +GRUB because of some other tasks, so the current maintainers Yoshinori +K. Okuji and Gordon Matzigkeit took over the maintainership, and opened the development in order for everybody to participate it. Technically speaking, GNU GRUB has many features that are not seen in diff --git a/docs/stamp-vti b/docs/stamp-vti index d6d80e375..4f0e4885e 100644 --- a/docs/stamp-vti +++ b/docs/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 16 April 2002 +@set UPDATED 29 April 2002 @set UPDATED-MONTH April 2002 @set EDITION 0.92 @set VERSION 0.92 diff --git a/docs/version.texi b/docs/version.texi index d6d80e375..4f0e4885e 100644 --- a/docs/version.texi +++ b/docs/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 16 April 2002 +@set UPDATED 29 April 2002 @set UPDATED-MONTH April 2002 @set EDITION 0.92 @set VERSION 0.92 diff --git a/stage2/builtins.c b/stage2/builtins.c index 8ac6656fd..7ed397bf2 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -3976,6 +3976,7 @@ terminal_func (char *arg, int flags) int dumb = 0; int saved_terminal = terminal; int lines = 0; + int no_message = 0; /* Get GNU-style long options. */ while (1) @@ -4003,6 +4004,8 @@ terminal_func (char *arg, int flags) return 1; } } + else if (grub_memcmp (arg, "--silent", sizeof ("--silent") - 1) == 0) + no_message = 1; else break; @@ -4113,7 +4116,9 @@ terminal_func (char *arg, int flags) /* Prompt the user, once per sec. */ if ((time1 = getrtsecs ()) != time2 && time1 != 0xFF) { - grub_printf ("Press any key to continue.\n"); + if (! no_message) + grub_printf ("Press any key to continue.\n"); + time2 = time1; if (to > 0) to--; @@ -4139,7 +4144,7 @@ static struct builtin builtin_terminal = "terminal", terminal_func, BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST, - "terminal [--dumb] [--timeout=SECS] [--lines=LINES] [console] [serial]", + "terminal [--dumb] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial]", "Select a terminal. When serial is specified, wait until you push any key" " to continue. If both console and serial are specified, the terminal" " to which you input a key first will be selected. If no argument is" @@ -4147,6 +4152,7 @@ static struct builtin builtin_terminal = " your terminal is dumb, otherwise, vt100-compatibility is assumed." " If --timeout is present, this command will wait at most for SECS" " seconds. The option --lines specifies the maximum number of lines." + " The option --silent is used to suppress messages." }; #endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */