diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/commit.d/_numbers /ram/gitcmp/partman-dmraid/6/git/commit.d/_numbers
--- /ram/gitcmp/partman-dmraid/6/svn/commit.d/_numbers	1970-01-01 01:00:00.000000000 +0100
+++ /ram/gitcmp/partman-dmraid/6/git/commit.d/_numbers	2009-08-07 14:13:13.854665326 +0200
@@ -0,0 +1 @@
+31 partition_multipath
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/commit.d/partition_multipath /ram/gitcmp/partman-dmraid/6/git/commit.d/partition_multipath
--- /ram/gitcmp/partman-dmraid/6/svn/commit.d/partition_multipath	1970-01-01 01:00:00.000000000 +0100
+++ /ram/gitcmp/partman-dmraid/6/git/commit.d/partition_multipath	2009-08-07 14:13:13.854665326 +0200
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. /lib/partman/lib/base.sh
+
+disable_swap
+
+for dev in $DEVICES/*; do
+	[ -d "$dev" ] || continue
+	cd $dev
+
+	[ -f device ] || continue
+	[ -f multipath ] || continue
+
+	# update partition mappings
+	kpartx -d -p -part $(cat device)
+	kpartx -a -p -part $(cat device)
+done
+
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/debian/control /ram/gitcmp/partman-dmraid/6/git/debian/control
--- /ram/gitcmp/partman-dmraid/6/svn/debian/control	2007-12-05 21:18:24.120284000 +0100
+++ /ram/gitcmp/partman-dmraid/6/git/debian/control	2009-08-07 14:13:13.854665326 +0200
@@ -1,13 +1,12 @@
-Source: partman-dmraid
+Source: partman-multipath
 Section: debian-installer
 Priority: optional
 Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
-Uploaders: Frans Pop <fjp@debian.org>
+Uploaders: Guido Guenther <agx@sigxcpu.org>
 Build-Depends: debhelper (>= 4.2.0), po-debconf (>= 0.5.0)
-Vcs-Svn: svn://svn.debian.org/d-i/trunk/packages/partman/partman-dmraid
 
-Package: partman-dmraid
+Package: partman-multipath
 XC-Package-Type: udeb
 Architecture: all
-Depends: ${misc:Depends}, partman-base (>= 114), di-utils (>= 1.14), dmraid-udeb, dmsetup-udeb
-Description: Adds support for Serial ATA RAID (dmraid) to partman
+Depends: ${misc:Depends}, partman-base, multipath-udeb, dmsetup-udeb
+Description: Adds support for multipath block devices to partman
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/debian/copyright /ram/gitcmp/partman-dmraid/6/git/debian/copyright
--- /ram/gitcmp/partman-dmraid/6/svn/debian/copyright	2007-06-19 12:02:03.174341000 +0200
+++ /ram/gitcmp/partman-dmraid/6/git/debian/copyright	2009-08-07 14:13:13.854665326 +0200
@@ -1,6 +1,8 @@
-Authors: Frans Pop
+Authors: Guido Guenther
 
-Copyright 2007 Frans Pop <elendil@planet.nl>
+Copyright 2007 Guido Guenther <agx@sigxcpu.org>
+
+based on partman-dmraid by Frans Pop
 
 This package is under the GNU General Public License, version 2, which can
 usually be found in /usr/share/common-licenses/GPL-2 on Debian systems.
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/debian/partman-multipath.install /ram/gitcmp/partman-dmraid/6/git/debian/partman-multipath.install
--- /ram/gitcmp/partman-dmraid/6/svn/debian/partman-multipath.install	1970-01-01 01:00:00.000000000 +0100
+++ /ram/gitcmp/partman-dmraid/6/git/debian/partman-multipath.install	2009-08-07 14:13:13.854665326 +0200
@@ -0,0 +1 @@
+post-base-installer.d/60multipath usr/lib/post-base-installer.d/
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/debian/rules /ram/gitcmp/partman-dmraid/6/git/debian/rules
--- /ram/gitcmp/partman-dmraid/6/svn/debian/rules	2007-06-19 12:02:03.174341000 +0200
+++ /ram/gitcmp/partman-dmraid/6/git/debian/rules	2009-08-07 14:13:13.859159297 +0200
@@ -5,7 +5,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-export PACKAGE = partman-dmraid
+export PACKAGE = partman-multipath
 
 build:
 # Ye olde no-op.
@@ -20,12 +20,14 @@
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	debian/install-rc choose_partition
+	dh_installdirs
 	debian/install-rc init.d
+	debian/install-rc commit.d
 
 binary-indep: build install
 	dh_testdir
 	dh_testroot
+	dh_install
 	dh_installdebconf
 	dh_fixperms
 	dh_installdeb
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/init.d/multipath_flag /ram/gitcmp/partman-dmraid/6/git/init.d/multipath_flag
--- /ram/gitcmp/partman-dmraid/6/svn/init.d/multipath_flag	1970-01-01 01:00:00.000000000 +0100
+++ /ram/gitcmp/partman-dmraid/6/git/init.d/multipath_flag	2009-08-07 14:13:13.859159297 +0200
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# This script sets the multipath flag for multipath'ed devices
+
+for dev in /var/lib/partman/devices/*; do
+	[ -d "$dev" ] || continue
+	cd $dev
+
+	[ -f device ] || continue
+	for frdisk in $(multipath -l | grep '^mpath[0-9]\+ ' | sed 's/\(mpath[0-9]\+\) .*/\1/'); do
+		case $(cat device) in
+			/dev/mapper/$frdisk)
+				>multipath
+				break
+				;;
+		esac
+	done
+done
+
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/init.d/_numbers /ram/gitcmp/partman-dmraid/6/git/init.d/_numbers
--- /ram/gitcmp/partman-dmraid/6/svn/init.d/_numbers	2007-06-30 10:19:47.500643000 +0200
+++ /ram/gitcmp/partman-dmraid/6/git/init.d/_numbers	2009-08-07 14:13:13.859159297 +0200
@@ -1,2 +1 @@
-02 sataraid_warning
-50 sataraid_flag
+50 multipath_flag
diff --recursive --new-file --unified --exclude=.svn --exclude=.git /ram/gitcmp/partman-dmraid/6/svn/post-base-installer.d/60multipath /ram/gitcmp/partman-dmraid/6/git/post-base-installer.d/60multipath
--- /ram/gitcmp/partman-dmraid/6/svn/post-base-installer.d/60multipath	1970-01-01 01:00:00.000000000 +0100
+++ /ram/gitcmp/partman-dmraid/6/git/post-base-installer.d/60multipath	2009-08-07 14:13:13.859159297 +0200
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+if [ $(multipath -l | grep '^mpath[0-9]\+' | wc -l) -eq 0 ]; then
+	exit 0
+fi
+
+apt-install multipath-tools-boot || true
+
+if [ -r /etc/multipath.conf ]; then
+	cp /etc/multipath.conf /target/etc/multipath.conf
+fi
+
+# copy over the persistent binding
+if [ -r /var/lib/multipath/bindings ]; then
+	mkdir -p /target/var/lib/multipath
+	cp /var/lib/multipath/bindings /target/var/lib/multipath/
+fi
+
+# the initramfs will be updated by the kernel installation
