4728c8
---
4728c8
 multipath/Makefile        |    3 +++
4728c8
 multipath/multipath.rules |   24 ++++++++++++++++++++++++
4728c8
 2 files changed, 27 insertions(+)
4728c8
4728c8
Index: multipath-tools-130222/multipath/multipath.rules
4728c8
===================================================================
4728c8
--- /dev/null
4728c8
+++ multipath-tools-130222/multipath/multipath.rules
4728c8
@@ -0,0 +1,24 @@
4728c8
+# multipath wants the devmaps presented as meaninglful device names
4728c8
+# so name them after their devmap name
4728c8
+SUBSYSTEM!="block", GOTO="end_mpath"
4728c8
+
4728c8
+ENV{MPATH_SBIN_PATH}="/sbin"
4728c8
+TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin"
4728c8
+
4728c8
+ACTION=="add", ENV{DEVTYPE}!="partition", \
4728c8
+	ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \
4728c8
+	TEST=="/etc/multipath.conf", \
4728c8
+	PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -c $tempnode", \
4728c8
+	ENV{DM_MULTIPATH_DEVICE_PATH}="1"
4728c8
+
4728c8
+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DEVTYPE}!="partition", \
4728c8
+	RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
4728c8
+
4728c8
+KERNEL!="dm-*", GOTO="end_mpath"
4728c8
+ENV{DM_UUID}=="mpath-?*|part[0-9]*-mpath-?*", OPTIONS+="link_priority=10"
4728c8
+ACTION!="change", GOTO="end_mpath"
4728c8
+ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath"
4728c8
+ENV{DM_SUSPENDED}=="1", GOTO="end_mpath"
4728c8
+ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath"
4728c8
+RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode"
4728c8
+LABEL="end_mpath"
4728c8
Index: multipath-tools-130222/multipath/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/multipath/Makefile
4728c8
+++ multipath-tools-130222/multipath/Makefile
4728c8
@@ -21,12 +21,15 @@ $(EXEC): $(OBJS)
4728c8
 install:
4728c8
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
4728c8
 	$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
4728c8
+	$(INSTALL_PROGRAM) -d $(DESTDIR)/lib/udev/rules.d
4728c8
+	$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/lib/udev/rules.d/62-multipath.rules
4728c8
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
4728c8
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
4728c8
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
4728c8
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir)
4728c8
 
4728c8
 uninstall:
4728c8
+	rm $(DESTDIR)/lib/udev/rules.d/62-multipath.rules
4728c8
 	rm $(DESTDIR)$(bindir)/$(EXEC)
4728c8
 	rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
4728c8
 	rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz