summaryrefslogtreecommitdiffstats
path: root/multipath_rules.patch
blob: 44b9e1e7fd278874773337bdcf6ae2726a6a3cdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
 multipath/Makefile        |    4 ++--
 multipath/multipath.rules |   13 +++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

Index: multipath-tools-090724/multipath/Makefile
===================================================================
--- multipath-tools-090724.orig/multipath/Makefile
+++ multipath-tools-090724/multipath/Makefile
@@ -22,7 +22,7 @@ install:
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
 	$(INSTALL_PROGRAM) -m 755 $(EXEC) mpath_wait $(DESTDIR)$(bindir)/
 	$(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d
-	$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
+	$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/40-multipath.rules
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
@@ -32,7 +32,7 @@ install:
 	fi
 
 uninstall:
-	rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
+	rm $(DESTDIR)/etc/udev/rules.d/40-multipath.rules
 	rm $(DESTDIR)$(bindir)/$(EXEC)
 	rm $(DESTDIR)$(bindir)/mpath_wait
 	rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
Index: multipath-tools-090724/multipath/multipath.rules
===================================================================
--- multipath-tools-090724.orig/multipath/multipath.rules
+++ multipath-tools-090724/multipath/multipath.rules
@@ -1,7 +1,8 @@
-#
-# udev rules for multipathing.
-# The persistent symlinks are created with the kpartx rules
-#
-
-# socket for uevents
-SUBSYSTEM=="block", RUN+="socket:/org/kernel/dm/multipath_event"
+# multipath wants the devmaps presented as meaninglful device names
+# so name them after their devmap name
+SUBSYSTEM!="block", GOTO="end_mpath"
+RUN+="socket:/org/kernel/dm/multipath_event"
+KERNEL!="dm-[0-9]*", GOTO="end_mpath"
+PROGRAM!="/sbin/mpath_wait %M %m", GOTO="end_mpath"
+ACTION=="add", RUN+="/sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -a -p p' -j %M -m %m"
+LABEL="end_mpath"