diff -Nru multipath-tools-0.4.9/debian/changelog multipath-tools-0.4.9/debian/changelog --- multipath-tools-0.4.9/debian/changelog 2016-02-04 09:52:38.000000000 -0500 +++ multipath-tools-0.4.9/debian/changelog 2016-02-04 10:00:40.000000000 -0500 @@ -1,3 +1,13 @@ +multipath-tools (0.4.9-3ubuntu7.7mpathlvm3mpathdandkpartx) UNRELEASED; urgency=medium + + * Remove partition device nodes of individual paths (for LVM on multipath) (LP: #1540401) + - debian/multipath-tools.dm-mpath-lvm.udev: udev rule for that. + - debian/initramfs/hooks: copy the udev rule and partx to the initramfs. + - debian/initramfs/init-top: load the dm-multipath module for 'multipath -c'. + - debian/rules: install the udev rule and init-top. + + -- Mauricio Faria de Oliveira Wed, 03 Feb 2016 20:45:02 -0200 + multipath-tools (0.4.9-3ubuntu7.7mpathdV1) UNRELEASED; urgency=medium * initramfs: run multipathd to support async device discovery diff -Nru multipath-tools-0.4.9/debian/initramfs/hooks multipath-tools-0.4.9/debian/initramfs/hooks --- multipath-tools-0.4.9/debian/initramfs/hooks 2016-02-04 09:52:38.000000000 -0500 +++ multipath-tools-0.4.9/debian/initramfs/hooks 2016-02-04 10:00:06.000000000 -0500 @@ -35,7 +35,7 @@ add_udev_rules() { - for rules in 95-multipath.rules; do + for rules in 12-dm-mpath-lvm.rules 95-multipath.rules; do if [ -e /lib/udev/rules.d/$rules ]; then cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/ fi @@ -47,6 +47,7 @@ for x in /lib/multipath/*; do copy_exec $x /lib/multipath/ done +copy_exec /usr/bin/partx add_udev_rules copy_exec /sbin/multipathd /sbin diff -Nru multipath-tools-0.4.9/debian/initramfs/init-top multipath-tools-0.4.9/debian/initramfs/init-top --- multipath-tools-0.4.9/debian/initramfs/init-top 1969-12-31 19:00:00.000000000 -0500 +++ multipath-tools-0.4.9/debian/initramfs/init-top 2016-02-04 10:00:06.000000000 -0500 @@ -0,0 +1,16 @@ +#!/bin/sh -e + +PREREQS="" + +prereqs() { echo "$PREREQS"; } + +case "$1" in + prereqs) + prereqs + exit 0 + ;; +esac + +if [ -x /sbin/modprobe ]; then + /sbin/modprobe -qba dm-multipath +fi diff -Nru multipath-tools-0.4.9/debian/multipath-tools.dm-mpath-lvm.udev multipath-tools-0.4.9/debian/multipath-tools.dm-mpath-lvm.udev --- multipath-tools-0.4.9/debian/multipath-tools.dm-mpath-lvm.udev 1969-12-31 19:00:00.000000000 -0500 +++ multipath-tools-0.4.9/debian/multipath-tools.dm-mpath-lvm.udev 2016-02-04 10:01:27.000000000 -0500 @@ -0,0 +1,26 @@ +# An individual device may be part of a multipath device. +# In such case, remove its partition device nodes so for +# LVM to scan/lock/use only the multipath device. +# - Check it on 'add' uevent. +# - Check it on 'change' uevent (it may change). + +SUBSYSTEM!="block", \ + GOTO="end_mpath" + +ACTION=="remove", \ + GOTO="end_mpath" + +ENV{DEVTYPE}=="partition", \ + IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH", \ + GOTO="end_mpath" + +PROGRAM=="/sbin/multipath -c $devnode", \ + ENV{DM_MULTIPATH_DEVICE_PATH}="1", \ + ENV{ID_FS_TYPE}="mpath_member", \ + RUN+="/usr/bin/partx -d --nr 1-1024 $devnode", \ + GOTO="end_mpath" + +# Not part of a multipath device. +ENV{DM_MULTIPATH_DEVICE_PATH}="" + +LABEL="end_mpath" diff -Nru multipath-tools-0.4.9/debian/rules multipath-tools-0.4.9/debian/rules --- multipath-tools-0.4.9/debian/rules 2016-02-04 09:52:38.000000000 -0500 +++ multipath-tools-0.4.9/debian/rules 2016-02-04 10:00:06.000000000 -0500 @@ -48,6 +48,8 @@ # initramfs stuff: install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/multipath install -D -m 755 debian/initramfs/kpartx.hook $(CURDIR)/debian/kpartx-boot/usr/share/initramfs-tools/hooks/kpartx + install -D -m 755 debian/initramfs/init-top \ + $(INITRAMFS)/scripts/init-top/multipath install -D -m 755 debian/initramfs/local-top \ $(INITRAMFS)/scripts/local-top/multipath install -D -m 755 debian/initramfs/local-premount \ @@ -73,6 +75,7 @@ dh_installinit -pmultipath-tools dh_installinit -pmultipath-tools --name=multipath-tools-boot --no-start -- start 21 S . dh_installudev -pkpartx --priority=95 + dh_installudev -pmultipath-tools --name=dm-mpath-lvm --priority=12 dh_installdebconf -pmultipath-tools-boot dh_installman dh_makeshlibs --add-udeb=multipath-udeb