bugGNU GRUB - Bugs: bug #52440, Invalid OpenBOOT path for a device

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52440: Invalid OpenBOOT path for a device

Submitted by:  Mathieu Malaterre <malat>
Submitted on:  Sat 18 Nov 2017 05:22:51 PM UTC  
 
Category: FilesystemSeverity: Major
Priority: 5 - NormalItem Group: Hardware-specific
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: 2.02Reproducibility: Every Time
Planned Release: None

Tue 21 Nov 2017 09:41:56 AM UTC, comment #1:

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.

> >
> > 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.

Mathieu Malaterre <malat>
Sat 18 Nov 2017 05:22:51 PM UTC, original submission:

Yaboot ofpath is currently the only
device-node-to-OF-path-translation-tool that worked "correctly" for
the tested G5 Power Macs.

E.g. when devalias in OF says it's "/ht/pci@9/k2-sata-root/k2-sata@0/disk@0".

We get for /dev/sda2:

  • grub-ofpathname returned

"/ht@0,f2000000/pci@9/k2-sata-root@c/disk@0:b" which didn't work

while

  • ofpath returned "/ht@0,f2000000/pci@9/k2-sata-root@c/@0/@0:2" which worked
Mathieu Malaterre <malat>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by malat (Submitted the item)
  • -unavailable- added by malat
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 18 Nov 2017 05:22:51 PM UTCmalatCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1