summaryrefslogtreecommitdiff
blob: 64fd28a36fc2d06334f137c40570415927e836f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- yaboot-1.3.12.orig/ybin/ofpath	2004-05-23 17:20:56.382633120 -0400
+++ yaboot-1.3.12/ybin/ofpath	2004-05-23 17:20:26.013249968 -0400
@@ -301,7 +301,13 @@
 	    HOST_LIST="$(for i in `find /proc/device-tree -name compatible` ; do
 			lgrep "$i" "k2-s-ata" ; done)"
 	    DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
-	    echo "${DEVICE_PATH##*device-tree}/k2-sata@$DEVICE_ID/disk@0:$PARTITION"
+	    K2_DEVICE_ID=0
+	    while [ "$DEVICE_PATH" = "" ] ; do
+	        SCSI_HOSTNUMBER=`expr $SCSI_HOSTNUMBER - 1`
+	        let "K2_DEVICE_ID += 1"
+	        DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
+	    done
+	    echo "${DEVICE_PATH##*device-tree}/k2-sata@$K2_DEVICE_ID/disk@0:$PARTITION"
 	    ;;
 	*)
 	    echo 1>&2 "$PRG: Driver: $SCSI_DRIVER is not supported"