grub-devel
[Top][All Lists]
Advanced

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

Re: Open Firmware: search devalias children for disks


From: Hollis Blanchard
Subject: Re: Open Firmware: search devalias children for disks
Date: Wed, 1 Sep 2004 09:21:13 -0500

On Sep 1, 2004, at 4:05 AM, Marco Gerards wrote:

Hollis Blanchard <address@hidden> writes:

The current Open Firmware code only examines the devaliases when
searching for disks present. (In general we probably want to search
the whole device tree, but this behavior is ok for now.)

The best behavior would be:

1) Look up all devaliases.
2) Look up all nodes in the tree that do not have a valid devalias.

What do you think about that?

That is to give preference to devices listed in devalias? I guess that would also ensure that the shorter aliases (e.g. "hd") appear in the UI rather than the full path. At any rate, it sounds reasonable.

I think the grub_children_iterate() function should help with that. However, some systems (large pSeries servers) have very big device trees, so if we're going to recurse we need to be careful about our stack space...

Also in that case, "ls" could take a long time to complete if the block devices it finds need to be spun up etc. pSeries have an OF-based menu called SMS (System Management Services) which can list all available disks, and that operation takes a while to complete. Another idea would be to have "ls" only show devaliases (i.e. quick), but also allow "ls /path/to/device/without/an/alias" to work.

However, note that I had to comment out the ":0" being appended to the
device path (e.g. "scsi/sd:0"). I'm still not sure why, but when the
":0" was present, open and close on the block device would succeed but
seek failed. :( More investigation may be needed, as I *think* the
stage1 loader loaded grubof using ":0" in the device name (as seen in
/chosen/bootpath). But with this patch on top of all the other patches
I've sent so far, I get the following output:

How was it added?  By tab completion?

The code present now explicitly adds ":0" inside grub_ofdisk_open().

I wonder what the ":0" means?  A partition?  The last used partition
or so.  I think I can look this up.

When I boot I do this: "boot scsi/sd:0". That seems to mean "find the first partition marked bootable in the partition map and boot that." I'm pretty sure that OF partition numbers are 1-based, so partition 1 is the partition map, and partition 0 has special meaning... it may only have special meaning for "boot". Hmm, maybe if I open :0 and do a read (without seek) it will give me the first block of my stage1. Might be worth playing with just for curiosity, but I'm really hoping that your system also works without the ":0"... otherwise I have more investigating to do.

One more possibility is that the ":0" partition can only be opened once at a time. As I mentioned, my stage1 seems to load from ":0" but I notice it does not close the ihandle after that. Perhaps that is causing a problem.

grub> ls
(scsi/sd) (scsi/sd,0) (scsi/sd,1) (scsi/sd,2) (scsi/sd,3) (scsi/sd,4)
(scsi/sd,5)
grub> ls (scsi/sd,5)/
lost+found/ dev/ etc/ tmp/ var/ proc/ bin/ boot/ home/ lib/ mnt/ opt/
root/ sbin/ usr/ halt

That's pretty good. :)

Absolutely!  Have you tested the linux loader, BTW?

Not yet, that ":0" took a lot of time to guess, and then it was past my bedtime... :)

-Hollis





reply via email to

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