grub-devel
[Top][All Lists]
Advanced

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

Re: GRUB device names wrt. ieee1275


From: Vesa Jääskeläinen
Subject: Re: GRUB device names wrt. ieee1275
Date: Sun, 15 Mar 2009 11:22:21 +0200
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

David Miller wrote:
> One issue I need to resolve before I can send finalized
> patches out for sparc is about device naming.
> 
> Currently the PowerPC ieee1275 support allows using both device
> aliases and full openfirmware device path names with the usual GRUB
> partition specification concatenated at the end.  For the most part
> this is fine.
> 
> This works for a large group of cases, but in general it will not
> work.
> 
> The problem is two fold:
> 
> 1) "," characters can appear anywhere in an openfirmware path
>    name.  For example my workstations disk is:
> 
>       
> /address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden
> 
>    There are no quick workarounds for this.  For example, even if we
>    can change the partition fetching code in GRUB to use "strrchr()"
>    instead of "strchr()" in kern/disk.c:grub_disk_open() it will
>    still think the above path has partition ",600000" or something
>    silly like that.

Actually related question here is that how do you specify similar device
paths in x86? Now that there is pci support and some kinda usb support
it could be good idea to specify exact device somehow in some use cases.

> 2) Disks can have multiple comma seperated components especially
>    on SCSI in OF path names.  For example a disk on target 2,
>    lun 3, would have final path component "address@hidden,3"
> 
>    And currently that ",3" would look like a parition specification
>    to GRUB.
> 
> Therefore, I would suggest that we adopt the openfirmware partition
> specification of ":" on GRUB for ieee1275 platforms.
> 
> Then we just have a machine specific path seperator, defined in
> some <grub/machine/foo.h> header file and the kernel/disk.c code
> and elsewhere use the macro instead of ","
> 
> Any objections?

So you propose following:

(/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden:1)
(/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden:a,1)

( $FW_DISK_NAME + ':' + $GRUB_PARTITION_SCHEME )

?

If we go that path we should use same delimeter for other archs to make
it a bit easier for users to understand how it works.

Lets try couple of examples:

1. (hd0) => a-d) device alias 'hd0', no partition

2. (hd0,1) => a-d) device alias 'hd0', partition '1'

3. (hd0:1) =>
  a) device alias 'hd0:1', no partition
  b) device alias 'hd0:1', no partition
  c) device alias 'hd0', partition '1'
  d) device alias 'hd0:1', no partition

4. 
(/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden)
  a) => device alias '/address@hidden', partition
'600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden'
  b) => device alias '/address@hidden', partition '600000'
  c) => device alias '/address@hidden', partition
'600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden'
  d) => device alias 
'/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden',
no partition

5. 
(/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden:1)
  a) => device alias '/address@hidden', partition
'600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden:1'
  b) => device alias '/address@hidden', partition '600000'
  c) => device alias 
'/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden',
parition '1'.
  d) => device alias 
'/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden',
parition '1'.

6. 
(/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden:)
  a) => device alias '/address@hidden', partition
'600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden:1'
  b) => device alias '/address@hidden', partition '600000'
  c) => device alias 
'/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden',
no partition parition.
  d) => device alias 
'/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden',
no partition parition.

Now the algorithms for a-d:

a) look for first comma, split there
b) look for first comma, split there, filter out results
c) look for ':', if found split there, otherwise go to a)
d) look for '/' at start, if found look for ':' to differentiate
partitions, if not found go to a)

Now lets play with phcoder's idea:

("/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden")
("/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden",1)
("/address@hidden,600000/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden",a,1)

This could be easier to get right. Thou still needs some learning curve
for user. This extension could be used to look out for all firmware
names (assuming they map to ascii/utf-8).





reply via email to

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