[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#261491: arcboot-installer and SCSI info under 2.6



Thiemo,

I think this patch should work.  Can you please take a look at it.


Index: arcboot-installer.postinst
===================================================================
--- arcboot-installer.postinst	(revision 21845)
+++ arcboot-installer.postinst	(working copy)
@@ -77,17 +77,32 @@
 
 # Fill the necessary PROM variables that will need to be set before the
 # system can be booted.
+version=$(uname -r | cut -d . -f 1,2)
 bootmin=$((`echo $bootdev |sed 's+/dev/sd++' |tr [a-h] [0-7]` * 16))
-bootdevline=`grep "^\ \+8\ \+$bootmin\ \+" /proc/partitions`
-BOOTBUS=`echo $bootdevline |cut -d/ -f3 |sed 's/^bus//'`
-BOOTID=`echo $bootdevline |cut -d/ -f4 |sed 's/^target//'`
-BOOTLUN=`echo $bootdevline |cut -d/ -f5 |sed 's/^lun//'`
+bootdevline=`grep "^\ \+8\ \+$bootmin\ \+" /proc/partitions | sed 's/.* //'`
+if [ "$version" = "2.6" ]; then
+    scsi_info=$(readlink /sys/block/$bootdevline/device | sed 's/.*\///')
+    BOOTBUS=`echo $scsi_info | cut -d: -f2`
+    BOOTID=`echo $scsi_info | cut -d: -f3`
+    BOOTLUN=`echo $scsi_info | cut -d: -f4`
+else
+    BOOTBUS=`echo $bootdevline |cut -d/ -f3 |sed 's/^bus//'`
+    BOOTID=`echo $bootdevline |cut -d/ -f4 |sed 's/^target//'`
+    BOOTLUN=`echo $bootdevline |cut -d/ -f5 |sed 's/^lun//'`
+fi
 
 rootmin=`echo $rootfs |sed 's+/dev/sd.++'`
-rootdevline=`grep "^\ \+8\ \+$rootmin\ \+" /proc/partitions`
-ROOTBUS=`echo $rootdevline |cut -d/ -f3 |sed 's/^bus//'`
-ROOTID=`echo $rootdevline |cut -d/ -f4 |sed 's/^target//'`
-ROOTLUN=`echo $rootdevline |cut -d/ -f5 |sed 's/^lun//'`
+rootdevline=`grep "^\ \+8\ \+$rootmin\ \+" /proc/partitions | sed 's/.* //'`
+if [ "$version" = "2.6" ]; then
+    scsi_info=$(readlink /sys/block/$rootdevline/device | sed 's/.*\///')
+    ROOTBUS=`echo $scsi_info | cut -d: -f2`
+    ROOTID=`echo $scsi_info | cut -d: -f3`
+    ROOTLUN=`echo $scsi_info | cut -d: -f4`
+else
+    ROOTBUS=`echo $rootdevline |cut -d/ -f3 |sed 's/^bus//'`
+    ROOTID=`echo $rootdevline |cut -d/ -f4 |sed 's/^target//'`
+    ROOTLUN=`echo $rootdevline |cut -d/ -f5 |sed 's/^lun//'`
+fi
 
 ROOTPART=$(($rootmin - 1))
 
Index: changelog
===================================================================
--- changelog	(revision 21845)
+++ changelog	(working copy)
@@ -1,3 +1,11 @@
+arcboot-installer (0.012) UNRELEASED; urgency=low
+
+  * Martin Michlmayr
+    - Print correct scsi PROM variables when running a 2.6 kernel.
+      Closes: #261491
+
+ -- Martin Michlmayr <tbm@cyrius.com>  Sat, 18 Sep 2004 17:40:50 +0100
+
 arcboot-installer (0.011) unstable; urgency=low
 
   * Martin Michlmayr

-- 
Martin Michlmayr
tbm@cyrius.com



Reply to: