[syslinux] [PATCH] chain.c32: add menu support to grub loader

Paul Bolle pebolle at tiscali.nl
Thu Jul 1 01:27:25 PDT 2010


On Wed, 2010-06-30 at 16:20 -0700, Gert Hulselmans wrote:
> Paul Bolle wrote:
> > Allow the grub loader to (optionally) support using a GRUB menu file.
> > For example
> >     chain fs grub=stage2,grub.conf
> >
> > will load GRUB's stage2 and pass the (absolute) path to the file
> > "grub.conf" in the Syslinux filesystem to GRUB's stage2. [...]
> Why do you add (drivenumber,partition) to the config file name?

In short:  because the patch only allows to use GRUB configuration files
from the Syslinux filesystem.

> When the user adds the drivenumber and partition to its config filename
> itself:
>   chain.c32 hd0,3 grub=/boot/grub/stage2,(hd1,10)/anotherconf.lst
> 
> you get a "bad" configfilename: (hd0,2)/(hd1,10)/anotherconf.lst

The optional [,<menu>] part is only a filename not a full path. (So is
the <loader> part, by the way.)

> In my patch, grub will search on the correct drive and partition
> automatically, when you just use /anotherconf.lst.

Your patch apparently uses paths (for both the stage2 file and the
configuration file). I thought that (most?) loaders, comparable to the
stage2 loader, load the files they need from the Syslinux filesystem.

(I guess that in your patch people may have to mix two different
syntaxes for drive/partition pairs:
   the Syslinux syntax: "hd0,3"; and
   the GRUB syntax: "(hd0,3)".
It seems better to always use the Syslinux syntax, even for paths to
GRUB files.)

> GRUB just searches its config file on the drive (passed via DL) and
> partition (install_partition). You don't need to add the right drive and
> partition to the config filename yourself.

It might not (always) be needed. But it is allowed. GRUB's installer
seems to do that itself too. So I choose to prefix the path with
"(drive,partition)" part. 


Paul




More information about the Syslinux mailing list