grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] search -d|--disk


From: Robert Millan
Subject: Re: [PATCH] search -d|--disk
Date: Tue, 23 Jun 2009 13:50:27 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Jun 22, 2009 at 09:51:35PM -0400, Pavel Roskin wrote:
> On Tue, 2009-06-23 at 01:48 +0200, Robert Millan wrote:
> 
> > This patch adds an option to the search command to restrict the search of
> > a file to a given disk.  It will then probe for the file in each of its
> > partitions, but not in other disks.
> 
> First of all, it would be great is all proposals to add more code come
> with a possible use case.

QEMU has a feature in which you can specify the boot drive from command
line (-boot parameter).  After i386-qemu port is merged, I plan to add
some code to read this from CMOS and export it to some variable.

When on GRUB, it is up to the user to decide what "boot this drive" means.
An interesting option is to search for a specific file in the disk we're told,
and then act upon it (e.g. configfile /grub.cfg, multiboot /grub.elf,
linux /vmlinuz, whatever).

> We are approaching the point when grub with
> all modules would become too big to some boot partitions.

Yes.  Note that search.mod is not included in i386-pc's core.img, though.

> "VAR" should be "DISK".
> 
> "in this disk" should be "on this disk" (disclaimer: English is not my
> native language).
> 
> "and its partitions" seems excessive to me.  If the disk has partitions,
> of course that where we would look.

Ok.

> The implementation is not working:
> 
> sh:grub> search -d foo -l /
>  hd0,3
> 
> I hope that it would be possible to specify a partition for the disk, so
> that we easily can look e.g. for a partition with label "/" on a disk
> with a partition containing "/boot/grub/grub.cfg".

I implemented it only for files.  It's trivial to do it for labels/uuids
too, but it's annoying because doing so results in code duplication.

In general, there's a lot of code duplication in search.mod.  I recently
tried to diminish that by merging search_label() with search_fs_uuid() but
it's still far from ideal.

Any suggestions on what to do about this?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

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