From patchwork Sat Sep 27 14:57:04 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: peter cros X-Patchwork-Id: 22976 Return-Path: X-Original-To: yaboot-devel@ozlabs.org Delivered-To: yaboot-devel@ozlabs.org Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.226]) by ozlabs.org (Postfix) with ESMTP id A1836DDDE3 for ; Sun, 28 Sep 2008 00:57:07 +1000 (EST) Received: by qb-out-0506.google.com with SMTP id a16so1147879qbd.39 for ; Sat, 27 Sep 2008 07:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=UoPWKsh24dN5jiwLY0udXmU6C5e7cPdcOq0NdhwbUE4=; b=UZQMRdVuIr33x4Y1wa5V/PhtPvpE89Kld4AAWOf84RDaIV2OuGdLgk2MaRQpRHKM8a FBoYRt0H8KTW4ceLHq1m+nYHyN2MaQzCxIZyMUiO0F1r5+0aRfdrbpO2rEfNFA+G0ZEa L0G2YlaMreWyEhQS+qeSF0toj4pC6iSuIg3n8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=TJpwKN+C+cCldHpckhZv9OCr5vuAtsNoOOuY0peTmE3Mh4XnvOmA9Kqen019iGxGV+ gxMs4ne4E0epuHud9l/G+uq9US/6RlY4WwXlA0/lG60isfXrpX95QSQg0aOWQ9nD67A2 2PQtYsfl2XoHgTELn579+rOqdsZ9PXlnQlAd4= Received: by 10.180.252.8 with SMTP id z8mr1274045bkh.82.1222527424835; Sat, 27 Sep 2008 07:57:04 -0700 (PDT) Received: by 10.180.237.14 with HTTP; Sat, 27 Sep 2008 07:57:04 -0700 (PDT) Message-ID: <48f46e890809270757i24409c08lf54e830549167937@mail.gmail.com> Date: Sun, 28 Sep 2008 00:57:04 +1000 From: "peter cros" To: yaboot-devel@ozlabs.org Subject: ofpath bugfix powerpc g5 dual sata MIME-Version: 1.0 X-BeenThere: yaboot-devel@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 14:57:08 -0000 Hi, I am submitting this small patch to fix a residual bug in ofpath, for Apple powerpc64 g5 with dual sata drives, ubuntu and possibly other installations which use dash as their default shell. When ybin runs ofpath in the target root system with the default shell (#! /bin/sh ), in ubuntu this is /bin/sh -> dash. The "let" statement used to increment the ID for multiple k2-sata drives, is not found by the dash shell as used by ubuntu, in my g5 for example. Failure to increment K2_DEVICE_ID returns the same k2-sata path for each of multiple sata drives, ybin fails to find correct boot drive. This patch just avoids using "let". Tested on powerpc g5 Openfirmware V4, dual sata drives, ubuntu 804. ----------------------------------- ~/src/gits$ diff -pu yaboot/ybin/ofpath test/ybin/ofpath -------------------------------------------------------- :$PARTITION" ----------------------------- peter cros --- yaboot/ybin/ofpath 2008-09-26 21:36:38.000000000 +1000 +++ test/ybin/ofpath 2008-09-26 16:41:00.000000000 +1000 @@ -306,7 +306,8 @@ scsi_ofpath() K2_DEVICE_ID=0 while [ "$DEVICE_PATH" = "" ] ; do SCSI_HOSTNUMBER=`expr $SCSI_HOSTNUMBER - 1` - let "K2_DEVICE_ID += 1" +# let not found in dash # 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