Re: ofpath vs ofpathname vs grub-ofpathname
Hi!
On 4/17/20 10:20 AM, Romain Dolbeau wrote:
> Le ven. 17 avr. 2020 à 10:17, John Paul Adrian Glaubitz
> <glaubitz@physik.fu-berlin.de> a écrit :
>> Can you edit Yaboot's ofpath script and set DEBUG=1, then run "ofpath" on both
>> /dev/sda1 and /dev/sdb1?
>
> First on the drives just in case, then on the partitions as requested:
> (...)
Thanks!
I have come up with this patch, can you test it on the mac-support branch?
diff --git a/scripts/ofpathname b/scripts/ofpathname
index 375154e..2e5d997 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -862,6 +862,13 @@ l2of_scsi()
OF_PATH=$OF_PATH/hub\@$hub_no/storage\@$storage_no/disk\@$disk_no
fi
+ elif [[ $fc = "sata" ]] ; then
+ plug_id=$(ls -dv $device_path/*/host* 2>/dev/null | grep -n "/host$HOST$")
+ [ -z "$plug_id" ] && {
+ plug_id=$(ls -dv $device_path/host* 2>/dev/null | grep -n "/host$HOST$")
+ }
+ plug_id=$((${plug_id%%:*}-1))
+
elif [[ $fc = "fibre-channel" ]]; then
local wwpn=`get_fc_wwpn "$device_path/../../fc_remote_ports*"`
@@ -954,8 +961,8 @@ l2of_scsi()
if [[ $scsi_name != "scsi" && "$PLATFORM" != "mac" ]]; then
scsi_name="scsi@$BUS"
OF_PATH=$OF_PATH/$scsi_name
- elif [[ $scsi_name != "scsi" && "$PLATFORM" = "mac" && $devtype != "ata" ]]; then
- scsi_name="@$BUS"
+ elif [[ $scsi_name != "scsi" && "$PLATFORM" = "mac" && $fc = "sata" ]]; then
+ scsi_name="@$plug_id"
OF_PATH=$OF_PATH/$scsi_name
fi
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Reply to: