Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JMnyW-00041y-Nz for mharc-grub-devel@gnu.org; Wed, 06 Feb 2008 12:22:20 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMnyT-000406-CH for grub-devel@gnu.org; Wed, 06 Feb 2008 12:22:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMnyN-0003x6-1i for grub-devel@gnu.org; Wed, 06 Feb 2008 12:22:16 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMnyM-0003wu-Ky for grub-devel@gnu.org; Wed, 06 Feb 2008 12:22:10 -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 1JMnyM-00026X-FP for grub-devel@gnu.org; Wed, 06 Feb 2008 12:22:10 -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 1JMnyH-0002Wa-En for grub-devel@gnu.org; Wed, 06 Feb 2008 18:22:08 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JMnL1-0000p1-DA for grub-devel@gnu.org; Wed, 06 Feb 2008 17:41:31 +0100 Date: Wed, 6 Feb 2008 17:41:31 +0100 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080206164131.GA3148@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline Content-Transfer-Encoding: 8bit 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. Subject: [PATCH] improve error messages 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: Wed, 06 Feb 2008 17:22:18 -0000 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Just a few error message improvements. -- 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 /.) --y0ulUmNC+osPPQO6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="improve_messages_ok.diff" * disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few grub_dprintf() calls. * kern/disk.c (grub_disk_read): Include grub_errmsg in out of range error message. diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/disk/raid.c ./disk/raid.c --- ../grub2/disk/raid.c 2007-12-30 09:52:03.000000000 +0100 +++ ./disk/raid.c 2008-02-06 17:25:19.000000000 +0100 @@ -86,6 +86,8 @@ grub_raid_open (const char *name, grub_d disk->id = array->number; disk->data = array; + grub_dprintf ("raid", "%s: total_devs=%d, disk_size=%d\n", name, array->total_devs, array->disk_size); + switch (array->level) { case 0: @@ -101,6 +103,8 @@ grub_raid_open (const char *name, grub_d disk->total_sectors = (array->total_devs - 1) * array->disk_size; break; } + + grub_dprintf ("raid", "%s: level=%d, total_sectors=%d\n", name, array->level, disk->total_sectors); return 0; } @@ -332,6 +336,8 @@ grub_raid_scan_device (const char *name) struct grub_raid_super_09 sb; struct grub_raid_array *p, *array = NULL; + grub_dprintf ("raid", "Scanning for RAID devices\n"); + disk = grub_disk_open (name); if (!disk) return 0; @@ -485,6 +491,8 @@ grub_raid_scan_device (const char *name) grub_sprintf (array->name, "md%d", array->number); + grub_dprintf ("raid", "Found array: %s\n", array->name); + /* Add our new array to the list. */ array->next = array_list; array_list = array; diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/disk.c ./kern/disk.c --- ../grub2/kern/disk.c 2008-02-01 01:49:39.000000000 +0100 +++ ./kern/disk.c 2008-02-06 17:25:19.000000000 +0100 @@ -367,8 +367,8 @@ grub_disk_read (grub_disk_t disk, grub_d if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE) { grub_error_push (); - grub_dprintf ("disk", "Read out of range: sector 0x%llx.\n", - (unsigned long long) sector); + grub_dprintf ("disk", "Read out of range: 0x%llx (%s).\n", + (unsigned long long) sector, grub_errmsg); grub_error_pop (); return grub_errno; } --y0ulUmNC+osPPQO6--