From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Cc: grub-devel@lists.gnu.org
Subject: Re: [PATCH] tell the user why they are in rescue mode
Date: Fri, 8 Feb 2008 02:10:29 +0100 [thread overview]
Message-ID: <20080208011029.GA4418@thorin> (raw)
In-Reply-To: <1202409267.5010.2.camel@xerces>
Hi Sam,
On Thu, Feb 07, 2008 at 06:34:26PM +0000, Sam Morris wrote:
> diff -ru grub2-1.96+20080203+orig/kern/main.c grub2-1.96+20080203+sam/kern/main.c
> --- grub2-1.96+20080203+orig/kern/main.c 2008-01-05 12:04:35.000000000 +0000
> +++ grub2-1.96+20080203+sam/kern/main.c 2008-02-07 08:41:01.000000000 +0000
> @@ -102,8 +102,13 @@
> /* Load the module. */
> grub_dl_load ("normal");
>
> - /* Ignore any error, because we have the rescue mode anyway. */
> - grub_errno = GRUB_ERR_NONE;
> + if (grub_errno != GRUB_ERR_NONE)
> + {
> + grub_printf ("Unable to enter 'normal' mode (error %d: %s)\n", grub_errno, grub_errmsg);
> +
> + /* We're about to continue into rescue mode, so clear the error. */
> + grub_errno = GRUB_ERR_NONE;
> + }
I just checked, and it seems we already have a function for this:
grub_print_error(). If you just invoke this function, do you get the
desired result?
Also, I wonder why the existing grub_print_error() call in the rescue loop
doesn't handle this already (in kern/rescue.c).
Perhaps all you need to do is remove these two lines?
diff -ur grub2/kern/main.c tmp/kern/main.c
--- grub2/kern/main.c 2008-01-05 13:04:35.000000000 +0100
+++ tmp/kern/main.c 2008-02-08 02:09:03.000000000 +0100
@@ -101,9 +101,6 @@
{
/* Load the module. */
grub_dl_load ("normal");
-
- /* Ignore any error, because we have the rescue mode anyway. */
- grub_errno = GRUB_ERR_NONE;
}
/* The main routine. */
--
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 /.)
next prev parent reply other threads:[~2008-02-08 1:12 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 [this message]
2008-02-08 18:44 ` Sam Morris
2008-02-08 19:15 ` Robert Millan
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=20080208011029.GA4418@thorin \
--to=rmh@aybabtu.com \
--cc=grub-devel@gnu.org \
--cc=grub-devel@lists.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.