diff mbox

multipath-tools/multipath multipath.rules

Message ID 20090929175228.32761.qmail@sourceware.org (mailing list archive)
State New, archived
Delegated to: Benjamin Marzinski
Headers show

Commit Message

bmarzins@sourceware.org Sept. 29, 2009, 5:52 p.m. UTC
None
diff mbox

Patch

--- multipath-tools/multipath/multipath.rules	2009/06/23 18:49:12	1.11.2.1
+++ multipath-tools/multipath/multipath.rules	2009/09/29 17:52:27	1.11.2.2
@@ -4,8 +4,12 @@ 
 # KERNEL!="dm-[0-9]*", ACTION=="add", PROGRAM=="/bin/bash -c '/sbin/lsmod | /bin/grep ^dm_multipath'", RUN+="/sbin/multipath -v0 %M:%m"
 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"
-PROGRAM=="/sbin/dmsetup ls --target multipath --exec /bin/basename -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", OPTIONS="last_rule"
-PROGRAM!="/bin/bash -c '/sbin/dmsetup info -c --noheadings -j %M -m %m | /bin/grep -q .*:.*:.*:.*:.*:.*:.*:part[0-9]*-mpath-'", GOTO="end_mpath"
-PROGRAM=="/sbin/dmsetup ls --target linear --exec /bin/basename -j %M -m %m", NAME="%k", RESULT=="?*", SYMLINK="mpath/%c", OPTIONS="last_rule"
+PROGRAM!="/sbin/dmsetup info -c --noheadings -j %M -m %m", GOTO="end_mpath"
+RESULT!="*:*:*:*:*:*:*:mpath-*", GOTO="kpartx_check"
+PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/sbin/kpartx -a -p p /dev/mapper/%c"
+OPTIONS="last_rule"
+LABEL="kpartx_check"
+RESULT!="*:*:*:*:*:*:*:part*-mpath-*", GOTO="end_mpath"
+PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c"
+OPTIONS="last_rule"
 LABEL="end_mpath"