From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JNHmw-0000Nl-JP for mharc-grub-devel@gnu.org; Thu, 07 Feb 2008 20:12:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNHmu-0000Lr-Vy for grub-devel@gnu.org; Thu, 07 Feb 2008 20:12:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNHmu-0000LA-FZ for grub-devel@gnu.org; Thu, 07 Feb 2008 20:12:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNHmu-0000L4-9M for grub-devel@gnu.org; Thu, 07 Feb 2008 20:12:20 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JNHmu-0005p7-0n for grub-devel@gnu.org; Thu, 07 Feb 2008 20:12:20 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JNHmr-0005VH-L2; Fri, 08 Feb 2008 02:12:18 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JNHl7-0001Ec-NF; Fri, 08 Feb 2008 02:10:29 +0100 Date: Fri, 8 Feb 2008 02:10:29 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080208011029.GA4418@thorin> References: <1202409267.5010.2.camel@xerces> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1202409267.5010.2.camel@xerces> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Cc: grub-devel@lists.gnu.org Subject: Re: [PATCH] tell the user why they are in rescue mode 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: Fri, 08 Feb 2008 01:12:21 -0000 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 I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)