ofpath generates wrong OpenFirmware path for boot device

Bug #1400030 reported by Matevz Langus
34
This bug affects 3 people
Affects Status Importance Assigned to Milestone
yaboot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

in Ubuntu 14.10 (powerpc) ofpath generates incorrect OpenFIrmware device path. This path is used in yaboot.conf and in ofboot.b

Because of this issue, system will not boot. The problem happens during install procedure and after otherwise sucessful installation system fails to boot.

Most likely (but not directly verified) the issue is already present in Ubuntu 14.04

ifpath returns:
ofpath /dev/sdb
/ht@0,f2000000/pci@9/k2-sata-root@c/@ffffffffffffffff/@0

while OF wants:
/ht@0,f2000000/pci@9/k2-sata-root@c/k2-sata@1/disk@0

Kernel got it right:
/proc/device-tree/ht@0,f2000000/pci@9/k2-sata-root@c/k2-sata@1/disk@0

Kernel version:
uname -a
Linux powermac 3.16.0-25-powerpc64-smp #33-Ubuntu SMP Tue Nov 4 12:22:53 UTC 2014 ppc64 ppc64 ppc64 GNU/Linux
lsb_release -rd
Description: Ubuntu 14.10
Release: 14.10
apt-cache policy yaboot
yaboot:
  Installed: 1.3.16-4ubuntu1
  Candidate: 1.3.16-4ubuntu1
  Version table:
 *** 1.3.16-4ubuntu1 0
        500 http://ports.ubuntu.com/ubuntu-ports/ utopic/main powerpc Packages
        100 /var/lib/dpkg/status

Machine: Powermac G5 QUAD, specs at:
https://gist.github.com/anonymous/5b3cc9c9fc91abf577ca

Tags: ppc yaboot
Revision history for this message
Matevz Langus (matevz-langus) wrote :
Download full text (3.1 KiB)

Hi,

if I use ofpath script of yaboot 1.3.17 (from git://ozlabs.org/srv/projects/yaboot/yaboot.git commit 0e48da7ef41c6fc36f80f44e5e4a329000412f88)

and apply the following patch, all works fine:

diff --git a/ybin/ofpath b/ybin/ofpath
index aff5583..ad0b388 100755
--- a/ybin/ofpath
+++ b/ybin/ofpath
@@ -280,19 +280,19 @@ scsi_ofpath()
 {
     case "$SCSI_DRIVER" in
        aic7xxx)
- HOST_LIST="$(for i in `find /proc/device-tree -name compatible` ; do
+ HOST_LIST="$(for i in `find /proc/device-tree/ -name compatible` ; do
                        lgrep "$i" "^ADPT" "^pci900[45]" "^pciclass,01000" ; done)"
            DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
            echo "${DEVICE_PATH##*device-tree}/@$DEVICE_ID:$PARTITION"
            ;;
        sym53c8xx)
- HOST_LIST="$(for i in `find /proc/device-tree -name compatible` ; do
+ HOST_LIST="$(for i in `find /proc/device-tree/ -name compatible` ; do
                        lgrep "$i" "^Symbios" "^pci1000" "^pciclass,01000" ; done)"
            DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
            echo "${DEVICE_PATH##*device-tree}/@$DEVICE_ID:$PARTITION"
            ;;
        mesh)
- HOST_LIST="$(for i in `find /proc/device-tree -name compatible` ; do
+ HOST_LIST="$(for i in `find /proc/device-tree/ -name compatible` ; do
                        lgrep "$i" "mesh" ; done)"
            DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
            echo "${DEVICE_PATH##*device-tree}/@$DEVICE_ID:$PARTITION"
@@ -300,26 +300,26 @@ scsi_ofpath()
        ata_k2|sata_svw)
             #Not all G5 device trees have a compatible "k2-sata" node
             #per channel use parent
- HOST_LIST="$(for i in `find /proc/device-tree -name compatible ` ; do
+ HOST_LIST="$(for i in `find /proc/device-tree/ -name compatible ` ; do
                        lgrep "$i" "k2-s-ata" ; done | sort)"
            DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
            K2_DEVICE_ID=0
            while [ "$DEVICE_PATH" = "" ] ; do
                SCSI_HOSTNUMBER=`expr $SCSI_HOSTNUMBER - 1`
- let "K2_DEVICE_ID += 1"
+ K2_DEVICE_ID=$(( $K2_DEVICE_ID + 1 ))
                DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
            done
            echo "${DEVICE_PATH##*device-tree}/k2-sata@$K2_DEVICE_ID/disk@0:$PARTITION"
            ;;
        usb-storage)
- HOST_LIST="$(for i in `find /proc/device-tree -name name | grep usb` ; do
+ HOST_LIST="$(for i in `find /proc/device-tree/ -name name | grep usb` ; do
                         lgrep "$i" "disk" ; done)"
             DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"
             echo "${DEVICE_PATH##*device-tree}:$PARTITION"
            ;;
        sbp2|"")
             # sbp-2 driver may not have a dir in /proc/scsi
- HOST_LIST="$(for i in `find /proc/device-tree -name name` ; do
+ HOST_LIST="$(for i in `find /proc/device-tree/ -name name` ; do
                         lgrep "$i" "sbp-2" ; done)"
             if [ "$SCSI_HOSTNUMBER" = "" ] ; then
                 SCS...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in yaboot (Ubuntu):
status: New → Confirmed
Revision history for this message
ArminiusTux (varus-ubuntus-9) wrote :

One and a half years later this issue is still plaguing PowerMac users:

https://bugs.launchpad.net/ubuntu/+source/yaboot/+bug/1575394
https://bugs.launchpad.net/ubuntu-mate/+bug/1575384
https://bugs.launchpad.net/lubuntu-software-center/+bug/1575389

I will attempt to modify the yaboot.conf file manually and will report back on my findings.

Thanks Matevz for leading me on the right track.

tags: added: ppc yaboot
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package yaboot - 1.3.17-2ubuntu2

---------------
yaboot (1.3.17-2ubuntu2) yakkety; urgency=medium

  * build-system.patch: CFLAGS += -U_FORTIFY_SOURCE -fno-stack-protector

 -- Adam Conrad <email address hidden> Mon, 02 May 2016 14:19:39 -0600

Changed in yaboot (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.