All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] tell the user why they are in rescue mode
Date: Fri, 8 Feb 2008 20:15:39 +0100	[thread overview]
Message-ID: <20080208191539.GA24599@thorin> (raw)
In-Reply-To: <pan.2008.02.08.18.44.27@robots.org.uk>

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

On Fri, Feb 08, 2008 at 06:44:26PM +0000, Sam Morris wrote:
> 
> While that works, the output looks like this:
> 
>  Entering rescue mode...
>  error: out of disk
>  > _
> 
> Which does not present the information in the clearest possible way: it 
> looks like the error happened in the rescue mode code, instead of the 
> normal mode code.
> 
> Also, the error message could be lost if any of the code between the 
> start of grub_enter_rescue_mode and its call to grub_print_error itself 
> triggers an error.
> 
> For these reasons I think it's better to call grub_print_error from 
> within grub_load_normal.

Agreed.  See attached patch.  Does this work as expected ?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)

[-- Attachment #2: rescue_mode.diff --]
[-- Type: text/x-diff, Size: 824 bytes --]

2008-02-08  Robert Millan  <rmh@aybabtu.com>

	* kern/main.c (grub_load_normal_mode): Do not reset `grub_errno'.  Call
	grub_print_error() instead.  This will let user know why we're entering
	rescue mode.
	Based on suggestions from Sam Morris.

diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp -N ../grub2/kern/main.c ./kern/main.c
--- ../grub2/kern/main.c	2008-01-05 13:04:35.000000000 +0100
+++ ./kern/main.c	2008-02-08 20:11:52.000000000 +0100
@@ -102,8 +102,8 @@ grub_load_normal_mode (void)
   /* Load the module.  */
   grub_dl_load ("normal");
   
-  /* Ignore any error, because we have the rescue mode anyway.  */
-  grub_errno = GRUB_ERR_NONE;
+  /* Something went wrong.  Print errors here to let user know why we're entering rescue mode.  */
+  grub_print_error ();
 }
 
 /* The main routine.  */

  reply	other threads:[~2008-02-08 19:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 18:34 [PATCH] tell the user why they are in rescue mode Sam Morris
2008-02-08  1:10 ` Robert Millan
2008-02-08 18:44   ` Sam Morris
2008-02-08 19:15     ` Robert Millan [this message]
2008-02-09 15:42       ` Sam Morris
2008-02-10 17:08         ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080208191539.GA24599@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.