<div dir="ltr">Hi,<br><br>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. <br><br>
When ybin runs ofpath in the target root system with the default shell (#! /bin/sh ), in ubuntu this is /bin/sh -&gt; dash.<br><br>The &quot;let&quot; 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.<br>
<br>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.<br><br>This patch just avoids using &quot;let&quot;. <br><br>Tested on powerpc g5 Openfirmware V4, dual sata drives, ubuntu 804.<br>
<br>&nbsp;-----------------------------------<br>~/src/gits$ diff -pu yaboot/ybin/ofpath test/ybin/ofpath<br>&nbsp;--------------------------------------------------------<br><br>--- yaboot/ybin/ofpath&nbsp;&nbsp;&nbsp; 2008-09-26 21:36:38.000000000 +1000<br>
+++ test/ybin/ofpath&nbsp;&nbsp;&nbsp; 2008-09-26 16:41:00.000000000 +1000<br>@@ -306,7 +306,8 @@ scsi_ofpath()<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; K2_DEVICE_ID=0<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while [ &quot;$DEVICE_PATH&quot; = &quot;&quot; ] ; do<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCSI_HOSTNUMBER=`expr $SCSI_HOSTNUMBER - 1`<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let &quot;K2_DEVICE_ID += 1&quot;<br>+# let not found in dash&nbsp;&nbsp;&nbsp; &nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let &quot;K2_DEVICE_ID += 1&quot;<br>+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; K2_DEVICE_ID=$((K2_DEVICE_ID+1))<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DEVICE_PATH=&quot;$(printhost $SCSI_HOSTNUMBER $HOST_LIST)&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; done<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;${DEVICE_PATH##*device-tree}/k2-sata@$K2_DEVICE_ID/disk@0:$PARTITION&quot;<br><br>-----------------------------<br>peter cros<br><br></div>