Re: [PATCH v2 4/5] Patch the CHRP boot script
- To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
- Cc: Rick Thomas <rbthomas@pobox.com>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, PowerPC List Debian <debian-powerpc@lists.debian.org>, Frank Scheiner <frank.scheiner@web.de>, nfont@linux.vnet.ibm.com
- Subject: Re: [PATCH v2 4/5] Patch the CHRP boot script
- From: Mathieu Malaterre <malat@debian.org>
- Date: Mon, 17 Dec 2018 21:34:44 +0100
- Message-id: <[🔎] CA+7wUsy2BSuVS8dty_jzbpTRjuoaFf9e38XkYZ=RR1kD00wNcg@mail.gmail.com>
- In-reply-to: <1511256444.2466.12.camel@kernel.crashing.org>
- References: <1511002334-1078-1-git-send-email-frank.scheiner@web.de> <1511002334-1078-5-git-send-email-frank.scheiner@web.de> <CA+7wUszfZNatc-Jrse+mz6++0_kzPeTDBJpesG+4QRYSDog_mA@mail.gmail.com> <8e495776-89cc-2968-5caf-13e82758d660@web.de> <CA+7wUswghXSR6aY6WKcgWGNOH0xedRhiJ7GeJQPo6fjGeWzv=g@mail.gmail.com> <36a89a41-0f7d-cab3-b82f-6ccf833e3b1a@web.de> <59F4EDE2-CD6B-4E56-B16E-592E38247887@physik.fu-berlin.de> <650ddb08-2c89-5688-a8d7-ac04dbdc2d79@web.de> <DB3B691C-EF9E-4CB9-8711-433D3297DA85@pobox.com> <c46149af-b2a5-1d15-2fda-cedda607d111@web.de> <CA+7wUsyLLrCUb_pV9GUbb+sU5tzQu3NaoduL9Zo-EY6r0Q_Y4w@mail.gmail.com> <1511256444.2466.12.camel@kernel.crashing.org>
On Tue, Nov 21, 2017 at 10:27 AM Benjamin Herrenschmidt
<benh@kernel.crashing.org> 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.
>
> +Nathan
>
> 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 <frank.scheiner@web.de> 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 [1] and possibly [2]), but I haven't tried this
> > > yet.
> > >
> > > [1]:
> > > https://web.archive.org/web/20040202053614/http://developer.apple.com/technotes/tn/tn2004.html
> > >
> > > [2]:
> > > https://web.archive.org/web/20040202060137/http://developer.apple.com:80/technotes/tn/tn2023.html
> > >
> > > >
> > > > 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
> > > (10,1):
> > > ```
> > > root@mac-mini:~# ofpath /dev/sda2
> > > /pci@f4000000/ata-6@d/@0:2
> > >
> > > root@mac-mini:~# ofpathname /dev/sda2
> > > /usr/sbin/ofpathname: line 812: warning: command substitution: ignored null
> > > byte in input
> > > /pci@f4000000/ata-6@d/scsi@0/sd@0,0
>
> 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.
OK. I see some difference in between ofpath and ofpathname now. I've
reported it upstream:
https://github.com/ibm-power-utilities/powerpc-utils/issues/30
Let's see how upstream is interested, hopefully we'll be able to make
some progress there.
> > >
> > > 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
> > > /pci@800000020000003/pci@2,4/pci1069,b166@1/scsi@0/@3:1
> > >
> > > root@p5-520q:~# ofpathname /dev/sda1
> > > /pci@800000020000003/pci@2,4/pci1069,b166@1/scsi@0/sd@3,0
> > >
> > > root@p5-520q:~# ofpath /dev/sda2
> > > /pci@800000020000003/pci@2,4/pci1069,b166@1/scsi@0/@3:2
> > >
> > > root@p5-520q:~# ofpathname /dev/sda2
> > > /pci@800000020000003/pci@2,4/pci1069,b166@1/scsi@0/sd@3,0
> > > ```
> > >
> > > 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 ?
>
> > > > 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 :)
>
> Cheers,
> Ben.
>
>
Reply to: