Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OeVBM-0008QJ-IU for mharc-grub-devel@gnu.org; Thu, 29 Jul 2010 11:38:04 -0400 Received: from [140.186.70.92] (port=43433 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeVBF-0008N6-UU for grub-devel@gnu.org; Thu, 29 Jul 2010 11:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeVB8-0000xB-53 for grub-devel@gnu.org; Thu, 29 Jul 2010 11:37:55 -0400 Received: from caffeine.csclub.uwaterloo.ca ([129.97.134.17]:57853) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeVB8-0000wt-1P for grub-devel@gnu.org; Thu, 29 Jul 2010 11:37:50 -0400 Received: from caffeine.csclub.uwaterloo.ca (localhost [127.0.0.1]) by caffeine.csclub.uwaterloo.ca (Postfix) with ESMTP id A8495D188 for ; Thu, 29 Jul 2010 11:37:49 -0400 (EDT) Received: by caffeine.csclub.uwaterloo.ca (Postfix, from userid 20367) id 96C92D189; Thu, 29 Jul 2010 11:37:49 -0400 (EDT) Date: Thu, 29 Jul 2010 11:37:49 -0400 To: The development of GNU GRUB Message-ID: <20100729153749.GP2632@caffeine.csclub.uwaterloo.ca> References: <4C50FE43.6020201@gmail.com> <4C513848.9070208@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C513848.9070208@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Detect if we actually have partitions and print raid info in "ls -l" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 15:38:03 -0000 On Thu, Jul 29, 2010 at 04:14:00AM -0400, Doug Nazar wrote: > On 2010-07-29 12:06 AM, Doug Nazar wrote: >> >> The second expands the 'ls -l' output to include raid information. >> Previously depending on the raid metadata layout, it was possible to >> detect the filesystem on the underlying raid partition. So now it >> checks for raid devices first and if detected prints out the raid >> info. This probably requires the previous patches for raid that have >> been posted in the last few days. Holler if you want a roll-up patch. >> >> Partition ide1,apple9: RAID6, md/1 - Disk 2/4, UUID >> 5c991134-a98c-2396-7204-9d6b077d2840 >> > > Realized I'd added a dependency on the raid module. This patch cleans > that up. > > Doug > > === modified file 'conf/common.rmk' > --- conf/common.rmk 2010-07-06 18:27:55 +0000 > +++ conf/common.rmk 2010-07-29 08:01:45 +0000 > @@ -104,7 +104,7 @@ > kernel_img_HEADERS += boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ > env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ > partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ > - list.h command.h i18n.h env_private.h libgcc.h > + list.h command.h i18n.h env_private.h libgcc.h raid.h > > ifneq ($(platform), emu) > kernel_img_HEADERS += machine/memory.h machine/loader.h > > === modified file 'disk/raid.c' > --- disk/raid.c 2010-07-29 04:26:32 +0000 > +++ disk/raid.c 2010-07-29 07:42:28 +0000 > @@ -724,7 +724,7 @@ > } > } > > -struct grub_raid_array * > +static struct grub_raid_array * > grub_raid_probe(grub_device_t dev, int *index, char **uuid) > { > struct grub_raid *p; > @@ -776,11 +776,13 @@ > > GRUB_MOD_INIT(raid) > { > + grub_raid_probe_func = grub_raid_probe; > grub_disk_dev_register (&grub_raid_dev); > } > > GRUB_MOD_FINI(raid) > { > grub_disk_dev_unregister (&grub_raid_dev); > + grub_raid_probe_func = 0; > free_array (); > } > > === modified file 'include/grub/raid.h' > --- include/grub/raid.h 2010-07-29 02:47:49 +0000 > +++ include/grub/raid.h 2010-07-29 08:08:27 +0000 > @@ -75,7 +75,9 @@ > > void grub_raid_block_xor (char *buf1, const char *buf2, int size); > > -struct grub_raid_array * grub_raid_probe(grub_device_t dev, int *index, char **uuid); > +typedef struct grub_raid_array * (*grub_raid_probe_func_t) (grub_device_t dev, > + int *index, > + char **uuid); > > typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_raid_array *array, > int disknr, char *buf, > @@ -89,5 +91,6 @@ > > extern grub_raid5_recover_func_t grub_raid5_recover_func; > extern grub_raid6_recover_func_t grub_raid6_recover_func; > +extern grub_raid_probe_func_t EXPORT_VAR(grub_raid_probe_func); > > #endif /* ! GRUB_RAID_H */ > > === modified file 'kern/device.c' > --- kern/device.c 2010-03-31 20:03:48 +0000 > +++ kern/device.c 2010-07-29 07:47:45 +0000 > @@ -25,6 +25,11 @@ > #include > #include > #include > +#include > + > +/* Toss it here for now. Perhaps in the future expand it to a > + generic helper function that checks raid, lvm, etc. */ > +grub_raid_probe_func_t grub_raid_probe_func; > > grub_device_t > grub_device_open (const char *name) > > === modified file 'normal/misc.c' > --- normal/misc.c 2010-07-29 02:47:49 +0000 > +++ normal/misc.c 2010-07-29 07:44:38 +0000 > @@ -54,11 +54,13 @@ > else if (dev->disk) > { > grub_fs_t fs; > - struct grub_raid_array *array; > + struct grub_raid_array *array = 0; > int disk_index; > char *array_uuid = 0; > - > - array = grub_raid_probe(dev, &disk_index, &array_uuid); > + > + if (grub_raid_probe_func) > + array = (*grub_raid_probe_func)(dev, &disk_index, &array_uuid); > + > if (!array) > { > fs = grub_fs_probe (dev); > OK, I added your last 5 or so patches, and yes the tab completion works great now on the md raid devices without partitions. Booting without devaliases on the other hand not so much. See comment on the patch in that thread. -- Len Sorensen