Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MPidS-00008W-2P for mharc-grub-devel@gnu.org; Sat, 11 Jul 2009 15:53:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPidP-00007r-LO for grub-devel@gnu.org; Sat, 11 Jul 2009 15:53:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPidL-0008Rm-RZ for grub-devel@gnu.org; Sat, 11 Jul 2009 15:53:23 -0400 Received: from [199.232.76.173] (port=48095 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPidL-0008Ra-KA for grub-devel@gnu.org; Sat, 11 Jul 2009 15:53:19 -0400 Received: from mail-px0-f193.google.com ([209.85.216.193]:49882) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MPidL-0001XP-2B for grub-devel@gnu.org; Sat, 11 Jul 2009 15:53:19 -0400 Received: by pxi31 with SMTP id 31so1139011pxi.14 for ; Sat, 11 Jul 2009 12:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ElrSID9a0cKCzHLcuRPjQvr5t6SKlUwKLfg7w1Emwa8=; b=BWIjxaNHZIeXK52eS7R6bOQvyhpW9W6IXLTPsabRw8X7j6VteFDXHpZMGG1PtYDnph DJGh2EO1Mu59yNnG6Es0rA3Qp9WAMpjqAmkfV9qWsN81blKyLqZqb/ND3PECEGze8OFa zZ4ZxWWPVQ+T6WTsCFUAcSPjJWiZdmkVaafd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qorW8eQbqjpTUB/+V5i8ZPYz5U15eu+plG4g+hdrf+ERXOrDQDludR2uEeBM7246gM h7RemDS7zX3S5PuRCf1jML5Ml5fFbGs+FtoptcmooynttQb+bX0lW7F2NA9sly0xpTLf djHYIV0WyF0LrK+Uv2kei98DslAWSjBB8pEkw= MIME-Version: 1.0 Received: by 10.115.54.7 with SMTP id g7mr5528771wak.147.1247341996652; Sat, 11 Jul 2009 12:53:16 -0700 (PDT) In-Reply-To: <20090711185310.GC18506@thorin> References: <20090711185310.GC18506@thorin> Date: Sun, 12 Jul 2009 03:53:16 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] hidemenu fix 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: Sat, 11 Jul 2009 19:53:23 -0000 On Sun, Jul 12, 2009 at 2:53 AM, Robert Millan wrote: > On Sat, Jul 11, 2009 at 01:26:50PM +0800, Bean wrote: >> 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. > > Hi Bean, > > I don't understand this very well. =A0First of all, which part is suppose= d > to be responsible for printing the header? =A0Are you changing that? =A0R= ight > now it is being printed twice. The menu would init screen and print a header, when you click "c", it clear screen again and print another header. This method should be the right way. Previously the later code is in normal reader, which cause screen to be cleared prematurely. > >> -static grub_err_t >> -grub_rescue_init (void) >> -{ >> - =A0grub_printf ("Entering rescue mode...\n"); >> - =A0return 0; >> -} >> - >> =A0/* Prompt to input a command and read the line. =A0*/ >> =A0static grub_err_t >> =A0grub_rescue_read_line (char **line, int cont) >> @@ -77,7 +70,6 @@ grub_rescue_read_line (char **line, int cont) >> =A0static struct grub_reader grub_rescue_reader =3D >> =A0 =A0{ >> =A0 =A0 =A0.name =3D "rescue", >> - =A0 =A0.init =3D grub_rescue_init, >> =A0 =A0 =A0.read_line =3D grub_rescue_read_line >> =A0 =A0}; > > Why is grub_rescue_init being removed? If it's not removed, it would print "Entering rescue mode..." before the timeout, as rescue reader is started quite early. This is not a big issue, but to get a silent effect, we can remove this as well. In effect, we can always tell the current reader from command prompt, there is no need for the "welcome" message. (It also saves a few bytes in kernel) > >> @@ -524,7 +517,6 @@ grub_normal_read_line (char **line, int cont) >> =A0static struct grub_reader grub_normal_reader =3D >> =A0 =A0{ >> =A0 =A0 =A0.name =3D "normal", >> - =A0 =A0.init =3D grub_normal_reader_init, >> =A0 =A0 =A0.read_line =3D grub_normal_read_line >> =A0 =A0}; > > And this one, too. =A0If readers are no longer responsible for printing a > header, shouldn't we adjust whatever code that was calling their > init functions, and the grub_reader struct as well? > > This patch looks like a kludge to me. =A0Can we discuss what's wrong with= the > current design, and what options do we have to solve this? I think the new handling is correct. The printing of header is the job of menu viewer, not reader. Suppose we switch to a graphic viewer, then the current design would have problem, as it assume control over the whole screen, but we might want to draw it in a window. Only menu viewer knows how to draw it properly. --=20 Bean