Re: [PATCH v2 4/5] Patch the CHRP boot script
On 11/21/2017 03:27 AM, Benjamin Herrenschmidt wrote:
> On Tue, 2017-11-21 at 09:56 +0100, Mathieu Malaterre wrote:
>> Hi Ben,
>> Sorry for the direct question, but I assumed you would know the
>> answer. We are currently trying to replace yaboot with grub-ieee1275
>> in debian-installer, but are facing a very small issue, namely with OF
>> path handling. It appears that on Apple hardware only `ofpath` from
>> Yaboot returns the correct path. Are you using grub on any of your
>> Apple hardware ? Thanks much for comments.
> I have used grub on Apple systems in the past but it's quite possible
> that I ended up fixing up the path by hand. To be honest I haven't
> booted any of my Apple systems in a while, but I still have some I
> can dig out to test if needed.
> Some more comments below...
>> See below for full context.
>> On Tue, Nov 21, 2017 at 7:51 AM, Frank Scheiner <email@example.com> wrote:
>>> Hi Rick,
>>> On 11/21/2017 02:48 AM, Rick Thomas wrote:
>>>> If you can tell me *exactly* what to do, and I don’t have to set up an
>>>> installation environment to do it, I’ll be happy to test ofpathname vs
>>>> ofpath vs devalias on my PowerPC test machine farm.
>>> Well, to be on the safe side, I think you need to use the latest versions of
>>> ofpath and ofpathname, hence running Debian Sid could be the easiest way to
>>> make sure this is the case.
>>> You need to have a disk installed, because ofpath and IIC also ofpathname do
>>> not or cannot translate non existing device aliases to OF paths.
>>> In general the commands I ran for the p5 520Q below should do. Assuming that
>>> the output of ofpathname will always be wrong for Power Macs, it should be
>>> sufficient to check only one partition.
>>> I think devalias does only save/return OF paths up to the disk level, but
>>> not up to the partition level. But the disk level should already be
>>> sufficient to detect differences to ofpath and/or ofpathname.
>>> You have to go to OF to run devalias, but with a glass console you won't be
>>> able to copy the output. There are ways to interact with the OF via telnet
>>> from another machine (see  and possibly ), but I haven't tried this
>>>> I have the following machines:
>>>> Power Mac G5 11,2,
>>>> Power Mac G5 7,2 (I think — it’s turned off right now)
>>>> Mac mini G4 10,1
>>> I have these types available, too, "except" for the 7,3 which currently
>>> won't start up correctly.
>>> Here's the output of ofpath and ofpathname for /dev/sda2 on the my Mac mini
>>> root@mac-mini:~# ofpath /dev/sda2
>>> root@mac-mini:~# ofpathname /dev/sda2
>>> /usr/sbin/ofpathname: line 812: warning: command substitution: ignored null
>>> byte in input
> So here, ofpathname gets confused by the fact that Linux shows ATA
> devices as scsi (which is a Linux'ism). ofpath has workarounds to deal
> with that which should probably be ported over.
>>> Also interesting, it looks like ofpathname cannot even give a "correct"
>>> result for an IBM machine, at least not for my p5 520Q:
>>> root@p5-520q:~# lsblk
>>> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
>>> sda 8:0 0 136.7G 0 disk
>>> ├─sda1 8:1 0 7M 0 part
>>> ├─sda2 8:2 0 131.1G 0 part
>>> ├─sda3 8:3 0 1K 0 part
>>> └─sda5 8:5 0 5.6G 0 part
>>> sr0 11:0 1 1024M 0 rom
>>> root@p5-520q:~# ofpath /dev/sda1
>>> root@p5-520q:~# ofpathname /dev/sda1
>>> root@p5-520q:~# ofpath /dev/sda2
>>> root@p5-520q:~# ofpathname /dev/sda2
>>> Please notice that ofpathname returns the same result for two different
>>> partitions. :-/
> Ouch. I think ofpathname is still maintained by some of our IBM guys
> isn't it ? Might be worth digging there (or fixing it up !).
> Nathan, do you know anything about this ?
I haven't seen this before.
I don't have access to a Mac to re-create what you're seeing above, if you can
send me the output from running the script with 'set -x' at the top I will take a
You could also do this for the command above that produces the waning on line 812.
>>>> Mac G4 3,4
>>>> Mac G4 dual core 3,6
>>> Results for these machines would be helpful. It should work to
>>> install/upgrade to Debian Sid on one machine only and just move the disk to
>>> the other machine later on for testing.
> I can test if you are willing to fix the script :)