Re: ofpath vs ofpathname vs grub-ofpathname
On 4/17/20 11:28 AM, Romain Dolbeau wrote:
> Le ven. 17 avr. 2020 à 11:26, Jeffrey Walton <noloader@gmail.com> a écrit :
>> If no one offers SSH access
>
> I'm going to try to let Adrian plays with my Quad, but if you have a
> different/older models the ability to try/port on it as well might be
> valuable nonetheless.
OK, I got it now:
root@powermacg5:/home/glaubitz/powerpc-utils# ./scripts/ofpathname /dev/sda1
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/ht@0,f2000000/pci@9/k2-sata-root@c/@0/@0:1
root@powermacg5:/home/glaubitz/powerpc-utils# ./scripts/ofpathname /dev/sdb1
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/ht@0,f2000000/pci@9/k2-sata-root@c/@1/@0:1
root@powermacg5:/home/glaubitz/powerpc-utils#
The additional change necessary was:
diff --git a/scripts/ofpathname b/scripts/ofpathname
index 375154e..6b05dba 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -830,6 +830,7 @@ l2of_scsi()
goto_dir $PWD "devspec"
OF_PATH=`$CAT $PWD/devspec`
+ SYS_PATH=$PWD
if [[ -z $OF_PATH ]]; then
err $ERR_NO_OFPATH
fi
@@ -948,6 +949,13 @@ l2of_scsi()
fi
fi
else
+
+ plug_id=$(ls -dv $SYS_PATH/*/host* 2>/dev/null | grep -n "/host$HOST$")
+ [ -z "$plug_id" ] && {
+ plug_id=$(ls -dv $SYS_PATH/host* 2>/dev/null | grep -n "/host$HOST$")
+ }
+ plug_id=$((${plug_id%%:*}-1))
+
# make sure the "scsi" information is on the end of the path
local scsi_name=${OF_PATH##/*/}
scsi_name=${scsi_name%%@*}
@@ -955,7 +963,7 @@ l2of_scsi()
scsi_name="scsi@$BUS"
OF_PATH=$OF_PATH/$scsi_name
elif [[ $scsi_name != "scsi" && "$PLATFORM" = "mac" && $devtype != "ata" ]]; then
- scsi_name="@$BUS"
+ scsi_name="@$plug_id"
OF_PATH=$OF_PATH/$scsi_name
fi
Adrian
--
.''`. 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: