Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
multipath-tools
> multipath-tools-add-udev-rules
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File multipath-tools-add-udev-rules of Package multipath-tools
commit f7ec05658a3badf968e7b8f7a77daf18e7b5c261 Author: Hannes Reinecke <hare@suse.de> Date: Wed Feb 27 20:29:15 2008 +0100 Add udev rules files Add SUSE specific rules files. Signed-off-by: Hannes Reinjecke <hare@suse.de> diff --git a/multipathd/71-multipath.rules b/multipathd/71-multipath.rules new file mode 100644 index 0000000..7b07826 --- /dev/null +++ b/multipathd/71-multipath.rules @@ -0,0 +1,37 @@ +# +# multipath and multipath partitions nodes are created in /dev/mapper/ +# + +KERNEL!="dm-*", GOTO="multipath_end" +ACTION=="offline|remove", GOTO="multipath_end" + +ENV{DM_STATE}!="ACTIVE", GOTO="multipath_end" + +PROGRAM="/sbin/dmsetup table -j %M -m %m", \ + RESULT=="*multipath*", ENV{ID_DMTYPE}="multipath" +RESULT=="", GOTO="multipath_end" + +RESULT=="*linear*", PROGRAM="/sbin/kpartx_id %M %m", RESULT=="*", ENV{ID_DMTYPE}="linear" + +ENV{ID_DMTYPE}=="linear|multipath", IMPORT{program}="/sbin/mpath_id %M %m" + +# Create persistent links for the multipath table +ENV{ID_DMTYPE}=="multipath", ENV{ID_MPATH}=="?*", \ + SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_MPATH}" + +# Create dm tables for partitions on multipath devices +ENV{ID_DMTYPE}=="multipath", ENV{ID_MPATH}=="?*", \ + RUN+="/sbin/kpartx -a -p -part /dev/$kernel" + +# Create persistent links for the partition +ENV{ID_DMTYPE}=="linear", ENV{ID_MPATH}=="?*", \ + SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_MPATH}" + +# Delete partition tables +# This doesn't work; we're never seeing any remove events as the +# tables for partitions keep this one busy +# ACTION=="offline", \ +# RUN+="/sbin/kpartx_delete %M %m" + +LABEL="multipath_end" + diff --git a/multipathd/72-multipath-compat.rules b/multipathd/72-multipath-compat.rules new file mode 100644 index 0000000..ac60158 --- /dev/null +++ b/multipathd/72-multipath-compat.rules @@ -0,0 +1,10 @@ +# +# SLES9 compability symlinks for multipathed devices +# + +# Devices +ENV{ID_DMTYPE}=="multipath", ENV{ID_MPATH}=="?*", \ + SYMLINK+="disk/by-name/$env{ID_MPATH}" +# Partitions +ENV{ID_DMTYPE}=="linear", ENV{ID_MPATH}=="?*", \ + SYMLINK+="disk/by-name/$env{ID_MPATH}" diff --git a/multipathd/96-multipath-late.rules b/multipathd/96-multipath-late.rules new file mode 100644 index 0000000..c401563 --- /dev/null +++ b/multipathd/96-multipath-late.rules @@ -0,0 +1,3 @@ +# event to be catched by multipathd +RUN+="socket:/org/kernel/dm/multipath_event" + diff --git a/multipathd/Makefile b/multipathd/Makefile index 259a266..7179096 100644 --- a/multipathd/Makefile +++ b/multipathd/Makefile @@ -52,6 +52,10 @@ install: install -d $(DESTDIR)$(rcdir) install -d $(DESTDIR)$(mandir) install -m 644 $(EXEC).8 $(DESTDIR)$(mandir) + install -d $(DESTDIR)$(udevdir) + install -m 644 71-multipath.rules $(DESTDIR)$(udevdir) + install -m 644 72-multipath-compat.rules $(DESTDIR)$(udevdir) + install -m 644 96-multipath-late.rules $(DESTDIR)$(udevdir) uninstall: rm -f $(DESTDIR)$(bindir)/$(EXEC)