[Bug 1400030] Re: ofpath generates wrong OpenFirmware path for boot device

Matevz Langus 1400030 at bugs.launchpad.net
Sun Dec 7 19:52:06 UTC 2014


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 at 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
                 SCSI_HOSTNUMBER=1

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to yaboot in Ubuntu.
https://bugs.launchpad.net/bugs/1400030

Title:
  ofpath generates wrong OpenFirmware path for boot device

Status in yaboot package in Ubuntu:
  New

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 at 0,f2000000/pci at 9/k2-sata-root at c/@ffffffffffffffff/@0

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

  
  Kernel got it right:
  /proc/device-tree/ht at 0,f2000000/pci at 9/k2-sata-root at c/k2-sata at 1/disk at 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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/yaboot/+bug/1400030/+subscriptions



More information about the foundations-bugs mailing list