device-mapper-multipath/0002-RH-multipath.rules.patch

55 lines
2.1 KiB
Diff
Raw Normal View History

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