All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vesa Jääskeläinen" <chaac@nic.fi>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: GRUB device names wrt. ieee1275
Date: Sun, 15 Mar 2009 11:22:21 +0200	[thread overview]
Message-ID: <49BCC8CD.7030903@nic.fi> (raw)
In-Reply-To: <20090314.151417.194555320.davem@davemloft.net>

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:
> 
> 	/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0
> 
>    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 "disk@2,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:

(/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0:1)
(/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0: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. (/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0)
  a) => device alias '/pci@1e', partition
'600000/pci@0/pci@9/pci@0/scsi@1/disk@0'
  b) => device alias '/pci@1e', partition '600000'
  c) => device alias '/pci@1e', partition
'600000/pci@0/pci@9/pci@0/scsi@1/disk@0'
  d) => device alias '/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0',
no partition

5. (/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0:1)
  a) => device alias '/pci@1e', partition
'600000/pci@0/pci@9/pci@0/scsi@1/disk@0:1'
  b) => device alias '/pci@1e', partition '600000'
  c) => device alias '/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0',
parition '1'.
  d) => device alias '/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0',
parition '1'.

6. (/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0:)
  a) => device alias '/pci@1e', partition
'600000/pci@0/pci@9/pci@0/scsi@1/disk@0:1'
  b) => device alias '/pci@1e', partition '600000'
  c) => device alias '/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0',
no partition parition.
  d) => device alias '/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0',
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:

("/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0")
("/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0",1)
("/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0",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).




  parent reply	other threads:[~2009-03-15  9:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-14 22:14 GRUB device names wrt. ieee1275 David Miller
2009-03-14 23:44 ` phcoder
2009-03-15  5:24   ` David Miller
2009-03-15  9:22 ` Vesa Jääskeläinen [this message]
2009-03-15 22:52   ` David Miller
2009-03-15 15:45 ` Robert Millan
2009-03-15 22:41   ` David Miller
2009-03-18 10:18     ` Robert Millan
2009-03-18 20:55       ` David Miller
2009-03-18 21:01         ` David Miller
2009-03-22  0:41           ` phcoder
2009-03-22  0:48             ` phcoder
2009-03-22  1:57               ` David Miller
2009-03-22  1:56             ` David Miller
     [not found]               ` <49C61E3D.3040901@gmail.com>
     [not found]                 ` <20090322.153022.233646325.davem@davemloft.net>
2009-03-22 22:51                   ` phcoder
2009-03-23  1:13                     ` David Miller
2009-03-22 12:22             ` Robert Millan
2009-03-23  4:23               ` David Miller

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=49BCC8CD.7030903@nic.fi \
    --to=chaac@nic.fi \
    --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.