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

Bug#388296: And with the patch this time.



Oh well, seems reportbug killed the patch when i got into mutt :/

Index: debian/postinst
===================================================================
--- debian/postinst	(revision 40788)
+++ debian/postinst	(working copy)
@@ -29,6 +29,25 @@
 case "`archdetect`" in
 	powerpc/chrp_pegasos)
 		kernel=`ls /target/boot/vmlinuz-2.* | sed -e 's%/target/boot/%%'`
+		if [ -d /proc/device-tree/openprom/firmware-version ]; then
+			firmware_version=`cat /proc/device-tree/openprom/firmware-version`
+			fv1=host="$(echo "$firmware_version" | cut -d. -f1)"
+			fv2=host="$(echo "$firmware_version" | cut -d. -f2)"
+			fv3=host="$(echo "$firmware_version" | cut -d. -f3)"
+			if [ "$fv1" -eq 1 ] && [ "$fv2" -eq 2 ] && [ "$fv3" -ge 99 ]; then
+				 partitions_start=1
+			else if [ "$fv1" -eq 1 ] && [ "$fv2" -ge 3 ]; then
+				 partitions_start=1
+			else if [ "$fv1" -ge 2 ]; then
+				 partitions_start=1
+			else
+				partitions_start=0
+			fi
+			fi
+			fi
+		else
+			partitions_start=0
+		fi
 
 		if [ -d /sys/block ] && type udevinfo >/dev/null 2>&1; then
 			bootfs_disk_syspath="$(dirname "$(udevinfo -q path -n "$bootfs_devfs")")"
@@ -55,14 +74,22 @@
 					lun="$(echo "$bootfs_disk" | cut -d: -f4)"
 					;;
 			esac
-			part="$(echo "$bootfs_devfs" | sed 's/[^0-9]*//')"
+			if [ "$partitions_start" -eq 0 ]; then
+				part=$(( "$(echo "$bootfs_devfs" | sed 's/[^0-9]*//')" - 1 ))
+			else
+				part="$(echo "$bootfs_devfs" | sed 's/[^0-9]*//')"
+			fi
 		else
 			kind=`echo $bootfs_devfs | sed -e 's%/dev/%%' -e 's%/host.*$%%'`
 			host=`echo $bootfs_devfs | sed -e 's%^.*host%%' -e 's%/bus.*$%%'`
 			bus=`echo $bootfs_devfs | sed -e 's%^.*bus%%' -e 's%/target.*$%%'`
 			target=`echo $bootfs_devfs | sed -e 's%^.*target%%' -e 's%/lun.*$%%'`
 			lun=`echo $bootfs_devfs | sed -e 's%^.*lun%%' -e 's%/part.*$%%'`
-			part=$((`echo $bootfs_devfs | sed -e 's%^.*part%%'`-1))
+			if [ "$partitions_start" -eq 0 ]; then
+				part=$((s "$(`echo $bootfs_devfs | sed -e 's%^.*part%%')" -1))
+			else
+				part="$(echo $bootfs_devfs | sed -e 's%^.*part%%')"
+			fi
 		fi
 
 		# We don't know how to map non ide or scsi disks
@@ -76,7 +103,7 @@
 				;;
 		esac
 
-		# map theidevice to the OF aliases from /proc/device-tree/aliases.
+		# map the device to the OF aliases from /proc/device-tree/aliases.
 		if [ -d /proc/device-tree/aliases ]; then
 			for alias in `ls /proc/device-tree/aliases/*`; do
 				device=`grep disk $alias | sed -e 's%@[^/]*/%/%g'`
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 40788)
+++ debian/changelog	(working copy)
@@ -1,9 +1,14 @@
 nobootloader (1.11) UNRELEASED; urgency=low
 
+  [ Colin Watson ]
   * Mark Open Firmware commands as untranslatable.
 
- -- Colin Watson <cjwatson@debian.org>  Wed, 30 Aug 2006 10:12:20 +0100
+  [ Sven Luther ]
+  * Check the pegasos firmware for versions older than 1.2.99, and substract
+    one from the partition number since those start counting partitions at 0.
 
+ -- Sven Luther <sven@tael.powerlinux.fr>  Tue, 19 Sep 2006 19:30:56 +0200
+
 nobootloader (1.10) unstable; urgency=low
 
   * If /sys/block and udevinfo are available, use them instead of devfs

Reply to: