[multipath] adapt to the new udev rules
authorroot <root@xa-s05.(none)>
Tue, 27 Sep 2005 08:25:21 +0000 (10:25 +0200)
committerroot <root@xa-s05.(none)>
Tue, 27 Sep 2005 08:25:21 +0000 (10:25 +0200)
dev.d/ and hotplug.d/ are deprecated.
Move multipath and multipath partitions triggers to rules.d/

Don't create /dev/ links anymore, we now use exclusively on /dev/mapper/

multipath/multipath.dev [deleted file]
multipath/multipath.rules

diff --git a/multipath/multipath.dev b/multipath/multipath.dev
deleted file mode 100644 (file)
index dab433d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-if [ ! "${ACTION}" = add ] ; then
-       exit
-fi
-
-if [ "${DEVPATH:7:3}" = "dm-" ] ; then
-       dev=$(</sys${DEVPATH}/dev)
-       map=$(/sbin/devmap_name $dev)
-       /sbin/kpartx -v -a /dev/$map
-else
-       /sbin/multipath -v0 ${DEVNAME}
-fi
index 39f266e..28bd142 100644 (file)
@@ -1,3 +1,22 @@
-# multipath wants the devmaps presented as meaninglful device names
-# so name them after their devmap name
-KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK="%c"
+#
+# multipath and multipath partitions nodes are created in /dev/mapper/
+# this file should be installed in /etc/udev/rules.d
+#
+# !! udev must not discard DM events !!
+# !! check the other installed rules !!
+#
+
+# lookup the devmap name
+#ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*",
+#      PROGRAM="/sbin/devmap_name %M %m"
+ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*",
+       PROGRAM="dmsetup -j %M -m %m --noopencount -n -c -o name info"
+
+# take care of devmap partitioning
+ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*",
+       RUN+="/sbin/kpartx -a /dev/mapper/%c"
+
+# insert new paths in multipath topology
+ACTION=="add", SUBSYSTEM=="block", KERNEL!="dm-*",
+       RUN+="/sbin/multipath -v0 %M:%m"
+