<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 -> dash.<br><br>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.<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 "let". <br><br>Tested on powerpc g5 Openfirmware V4, dual sata drives, ubuntu 804.<br>
<br> -----------------------------------<br>~/src/gits$ diff -pu yaboot/ybin/ofpath test/ybin/ofpath<br> --------------------------------------------------------<br><br>--- yaboot/ybin/ofpath 2008-09-26 21:36:38.000000000 +1000<br>
+++ test/ybin/ofpath 2008-09-26 16:41:00.000000000 +1000<br>@@ -306,7 +306,8 @@ scsi_ofpath()<br> K2_DEVICE_ID=0<br> while [ "$DEVICE_PATH" = "" ] ; do<br> SCSI_HOSTNUMBER=`expr $SCSI_HOSTNUMBER - 1`<br>
- let "K2_DEVICE_ID += 1"<br>+# let not found in dash # let "K2_DEVICE_ID += 1"<br>+ K2_DEVICE_ID=$((K2_DEVICE_ID+1))<br> DEVICE_PATH="$(printhost $SCSI_HOSTNUMBER $HOST_LIST)"<br>
done<br> echo "${DEVICE_PATH##*device-tree}/k2-sata@$K2_DEVICE_ID/disk@0:$PARTITION"<br><br>-----------------------------<br>peter cros<br><br></div>