From patchwork Sun Dec 7 19:48:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matevz Langus X-Patchwork-Id: 418505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 69984140082 for ; Mon, 8 Dec 2014 07:06:19 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 50EB71A0B8E for ; Mon, 8 Dec 2014 07:06:19 +1100 (AEDT) X-Original-To: yaboot-devel@lists.ozlabs.org Delivered-To: yaboot-devel@lists.ozlabs.org X-Greylist: delayed 1049 seconds by postgrey-1.35 at bilbo; Mon, 08 Dec 2014 07:06:15 AEDT Received: from ris.borea.si (ris.borea.si [193.77.156.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4E6901A09D3 for ; Mon, 8 Dec 2014 07:06:15 +1100 (AEDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by ris.borea.si (Postfix) with ESMTP id 707C33A302CE for ; Sun, 7 Dec 2014 20:48:32 +0100 (CET) X-Virus-Scanned: amavisd-new at borea.si Received: from ris.borea.si ([127.0.0.1]) by localhost (ris.borea.si [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R5MbVgsGg6vN for ; Sun, 7 Dec 2014 20:48:30 +0100 (CET) Received: from [192.168.234.10] (BSN-77-101-6.static.siol.net [193.77.101.6]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ris.borea.si (Postfix) with ESMTP id 845763A302A6 for ; Sun, 7 Dec 2014 20:48:29 +0100 (CET) Message-ID: <5484AF07.60304@borea.si> Date: Sun, 07 Dec 2014 20:48:23 +0100 From: Matevz Langus User-Agent: Mozilla/5.0 (X11; Linux ppc64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: yaboot-devel@lists.ozlabs.org Subject: ofpath does not generate device name X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Yaboot-devel" Hi, I tried latest version of yaboot on Ubuntu 14.10 on PowerMac G5 Quad. ofpath script does not generate OF device name for my boot disk. Additional issue is usage of let statement in the script. This works with BASH, but default in Ubuntu is DASH. Both issues fixed in the patch bellow. best regards, Matevz Langus ;; 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 SCSI_HOSTNUMBER=1 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"