Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MjCrx-0007Fs-Mz for mharc-grub-devel@gnu.org; Thu, 03 Sep 2009 10:00:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjCrv-0007DY-1L for grub-devel@gnu.org; Thu, 03 Sep 2009 10:00:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjCrq-00078d-G1 for grub-devel@gnu.org; Thu, 03 Sep 2009 10:00:54 -0400 Received: from [199.232.76.173] (port=33495 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjCrp-00078O-Qe for grub-devel@gnu.org; Thu, 03 Sep 2009 10:00:49 -0400 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:54923) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjCrp-0002iU-LO for grub-devel@gnu.org; Thu, 03 Sep 2009 10:00:49 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjCro-0002Zc-Fd for grub-devel@gnu.org; Thu, 03 Sep 2009 14:00:48 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1MjCro-0004xV-00; Thu, 03 Sep 2009 15:00:48 +0100 Date: Thu, 3 Sep 2009 15:00:48 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20090903140047.GW13423@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH] Quieten normal mode startup unless a prompt is going to be displayed X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 14:00:55 -0000 Normal mode startup currently displays some text that really only makes sense if it's about to display a shell prompt. If it ends up displaying the menu, then that'll set up the screen for itself anyway; but in that case it really makes no sense to display a help message about BASH-like line editing being supported. 2009-09-03 Colin Watson Display normal mode shell introductory message only when it makes sense to do so. * normal/main.c (grub_normal_reader_init): Rename to ... (grub_normal_display_intro): ... this. (grub_normal_read_line): Display introductory message if it has not yet been displayed. (grub_normal_reader): Don't set init method. Index: normal/main.c =================================================================== --- normal/main.c (revision 2561) +++ normal/main.c (working copy) @@ -503,7 +503,7 @@ } static grub_err_t -grub_normal_reader_init (void) +grub_normal_display_intro (void) { grub_normal_init_page (); grub_setcursor (1); @@ -524,7 +524,14 @@ { grub_parser_t parser = grub_parser_get_current (); char prompt[8 + grub_strlen (parser->name)]; + static int displayed_intro; + if (! displayed_intro) + { + grub_normal_display_intro (); + displayed_intro = 1; + } + grub_sprintf (prompt, "%s:%s> ", parser->name, (cont) ? "" : "grub"); while (1) @@ -547,7 +554,6 @@ static struct grub_reader grub_normal_reader = { .name = "normal", - .init = grub_normal_reader_init, .read_line = grub_normal_read_line }; -- Colin Watson [cjwatson@ubuntu.com]