[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Open Firmware: search devalias children for disks
From: |
Hollis Blanchard |
Subject: |
Open Firmware: search devalias children for disks |
Date: |
Wed, 1 Sep 2004 00:11:24 -0500 |
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.)
However when SCSI disks are present, the devalias is to the SCSI
controller node, and under that are the block- and byte-oriented
devices sd and st. Example:
/bandit/gc/53c94
/address@hidden,0
/address@hidden,0
This patch (for comment only right now) allows grub2 to consider the
children of devaliases when looking for disks, which lets it find the
sd node above.
grub_ofdisk_open() was modified to avoid resolving aliases by hand;
OF's open and finddevice do it for us. Also the error checking it was
doing was a little off.
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:
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. :)
-Hollis
grub-ofdisk-scsi.diff
Description: Binary data