grub-devel
[Top][All Lists]
Advanced

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

Re: retiring device.map


From: Pavel Roskin
Subject: Re: retiring device.map
Date: Wed, 07 May 2008 13:22:50 -0400

On Wed, 2008-05-07 at 15:03 +0200, Robert Millan wrote:
> On Tue, May 06, 2008 at 11:43:48AM -0400, Pavel Roskin wrote:
> > On Tue, 2008-05-06 at 17:18 +0200, Robert Millan wrote:
> > 
> > > I completely agree.  How do we go about this?  First of all we need 
> > > support
> > > for labels, right?
> > 
> > We have it already in the "search" command.  Of course, there is always
> > room for improvement.  GRUB doesn't recognize Linux swap labels.  It
> > cannot set root to, say, partition 3 on a disk where partition 1 has the
> > given label.
> 
> Sorry, I was confusing labels with UUIDs.  The problem with labels is they're
> not garanteed to be unique, right?  So maybe we need support for UUIDs..

Right.

> > Anyway, the fix belongs to the installer.  The first step would be not
> > to use device.map is it's not needed.  In other words, if it's not a
> > cross-device install, don't read device.map and don't try to create it.
> 
> I think this isn't an easy as it looks.  grub-setup works much like grub-emu
> in that it uses code from outside util/, which only understands devices when
> represented in GRUB syntax.
> 
> Maybe we could force-feed it something like "(/dev/something)" as if it
> were a GRUB drive, but then how would it know how are partitions represented
> by the OS?  (%d, p%d, etc)

Yes, that would be consistent with our use of names having everything
needed for the access, without any mapping (like hd96 or ata2).

We could probably try all possible partition styles for the given OS
(numbers, letters, p + number).  If we only needed mounted partitions,
we could go through the list and check mounted devices for being
partitions of the drive.  Anyway, I'm afraid that part will remain
OS-specific for now.

> > Finally, update-grub should be modified to look for partitions by
> > labels.
> 
> We can do this already, without changing how device.map works.  Though, we
> need to reuse the same code in GRUB to obtain the labels (for robustness),
> which would need some new option in grub-probe or so.

Agreed.  And we could probably use UUIDs too (optionally), although
labels seem more readable to me.

-- 
Regards,
Pavel Roskin




reply via email to

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