[coreboot] GRUB2 Questions
joe at settoplinux.org
Sat May 10 04:03:43 CEST 2008
> -----Original Message-----
> From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org]
> On Behalf Of Patrick Georgi
> Sent: Friday, May 09, 2008 3:09 PM
> To: joe at settoplinux.org
> Cc: Coreboot
> Subject: Re: [coreboot] GRUB2 Questions
> Am Fri, 09 May 2008 10:51:01 -0400
> schrieb Joseph Smith <joe at settoplinux.org>:
> > Yes, I think that would work out fine. What kind of effort would it
> > take for "the (memdisk)/grub.cfg look up the available devices and
> > search for grub.cfg files there, passing control to them" ?? I think
> > this would kind of neat, almost like looking for the boot/partition
> > table on the mbr of each drive.
> a crude variant of it would be adding the "search" module, then having
> a (memdisk)/grub.cfg like:
> search -f -s /grub.cfg
> configfile /grub.cfg
> search looks for the file (-s) called (/grub.cfg) on all devices, and
> set a variable (-s) to the first one that carries that file. If no
> variable name is given, "root" is used, which is used as default
> device, so configfile /grub.cfg uses that.
> the search command should probably be extended to be able to omit
> devices (eg. memdisk - no endless loop possible), and to find the
> second, third, ... device.
Why would searching memdisk create a endless loop??
You could just create a search_disk() function with a for or while loop and
a break when it reaches a certain point, right?
Here is a thought. Before searching, is it possible to count how many files
there are in the current directory? And, then it could run the for or while
loop for that many times and if it doesn't find grub.conf, break and move
We could even specify only a few directories to search in to speed the
search process up.
More information about the coreboot