grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search command.


From: Centurion Computer Technology (2005) Ltd
Subject: Re: Search command.
Date: Thu, 12 Mar 2009 13:12:24 +1300

On Thu, 2009-03-12 at 12:52 +1300, Centurion Computer Technology (2005)
Ltd wrote:
> On Wed, 2009-03-11 at 00:04 -0400, Pavel Roskin wrote:
> > On Wed, 2009-03-11 at 13:34 +1300, Centurion Computer Technology (2005)
> > Ltd wrote:
> > > Hi,
> > > 
> > > I am playing with the search command in grub2 from debian experimental
> > > and have noticed some oddness
> > > 
> > > The search command currently returns the device as hdX,X rather than
> > > (hdX,X).  This means that the variable created using -s can't be used as
> > > a replacement for the device string.
> > 
> > Actually, you can assign it to the root variable and use relative path.
> > You don't need parentheses in the root variable.
> > 
> > >   For Example I'd like to be able to
> > > do this:
> > > 
> > > # Set our root device
> > > search -f /grub/grub.cfg -s root
> > > # Set our prefix 
> > > set prefix=${root}/grub/  # I think broken variable handling means this
> > > doesn't work.
> > 
> > True.  Variable expansion is broken.  But you can use
> > 
> > set prefix=/grub/
> but this means as soon as root is set to the new device, that we can't
> load anymore modules which breaks chainloader, linux, intrd, boot etc
> 
> and it appears preloading boot doesn't work anyway, as it tries to find
> it.  This problem doesn't occur if I manually set prefix=(hdX,X)/grub
> > 
> > That would allow you to load more modules as long as $root is
> > unchanged.
> > 
> > > menuentry "My Linux OS" {
> > > search -s LINUX_ROOT -u XXXX-YYYY-ZZZZ-AAAA-BBBB
> > > set root=$LINUX_ROOT
> > 
> > This is broken for the same reason.  But this would work:
> > 
> > search -s root -u XXXX-YYYY-ZZZZ-AAAA-BBBB
> Nope, as above, because we cannot set Prefix to include the device
> programmatically, as soon as you've changed your root, you can no longer
> load modules or use commands.

An easy fix would be for search to return the device with parentheses

This would solve most of the problems, and allow for:
search -s OSdevice -u XXXX-YYYY-ZZZZ-AAAA-BBBB
chainloader ${OSdevice}+1


-- 
Daniel Reurich

Centurion Computer Technology (2005) Limited.
Ph: 021 797 722





reply via email to

[Prev in Thread] Current Thread [Next in Thread]