All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Scan root device dynamically at startup
Date: Thu, 29 May 2008 11:58:12 +0200	[thread overview]
Message-ID: <20080529095812.GA28156@thorin> (raw)
In-Reply-To: <ca0f59980805280753q5f51ce75h88899815958620c9@mail.gmail.com>

On Wed, May 28, 2008 at 10:53:07PM +0800, Bean wrote:
> 
> In function grub_set_root_dev (main.c), it uses prefix to calculated
> root, so setting prefix is sufficient.
> 
> About the name, well, findprefix works for me too.
> 
> > Also, what this module is doing looks very similar to "search --set".  Did
> > you check if search command can be used for what you want?  (or otherwise
> > adapted)
> 
> The findroot module is used to locate normal.mod. But search is a
> command, it can only be used after normal.mod has been loaded.

I've been thinking a bit more about this, and my impression is that it the
approach is quite ad-hoc.  For example, some similar problems that this
solution wouldn't solve, but that a very similar solution would:

 a- normal.mod was built into grub.elf (perhaps because the firmware can load
    big files).  Then the problem is finding grub.cfg instead of normal.mod.

 b- User has a disk liing around which happens to have a normal.mod from
    an earlier version of grub (let's assume different ABI).  Turns out this
    disk is used for something else and can't be supressed.  A solution could
    be to use UUIDs for the search, but that can't always work since we need
    a "smart" install process that can probe for them (unlike in the situation
    you described -- I can't imagine doing fancy stuff in bare-bones Vista).

 c- Search for normal.mod was ok, but then this particular port of grub can't
    accept the prefix variable from your module, because it already got this
    variable from the firmware (OFW does this).  And the variable from firmware
    happens to be completely unusable.

I think a solution that would fit well here is to use memdisk to embed a
grub.cfg.  Then in each situation we could have a different grub.cfg script
that finds appropiate prefix using the search command.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)



  reply	other threads:[~2008-05-29  9:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 10:22 [PATCH] Scan root device dynamically at startup Bean
2008-05-28 13:54 ` Robert Millan
2008-05-28 14:53   ` Bean
2008-05-29  9:58     ` Robert Millan [this message]
2008-05-29 10:46       ` Bean
2008-05-29 12:05         ` Tomáš Ebenlendr
2008-05-29 12:38           ` Robert Millan
2008-05-30 13:29           ` Robert Millan
2008-05-30 13:35             ` Bean
2008-05-29 12:50         ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080529095812.GA28156@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.