chiark / gitweb /
e104a175d63ea8cf8d9ab8c4e1c58d71bb8a8d81
[elogind.git] / etc / udev / gentoo / 64-device-mapper.rules
1 # device mapper links hook into "change" events, when the dm table
2 # becomes available; some table-types must be ignored
3
4 KERNEL=="device-mapper",        NAME="mapper/control"
5
6 KERNEL!="dm-*", GOTO="device_mapper_end"
7 ACTION!="add|change", GOTO="device_mapper_end"
8
9 # lookup device name
10 # use dmsetup, until devmap_name is provided by sys-fs/device-mapper
11 PROGRAM=="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info",
12         ENV{DM_NAME}="%c"
13
14 # do not do anything if dmsetup does not provide a name
15 ENV{DM_NAME}=="", NAME="", OPTIONS="ignore_device"
16
17 # ignore luks crypt devices while not fully up
18 ENV{DM_NAME}=="temporary-cryptsetup-*", NAME="", OPTIONS="ignore_device"
19
20 # use queried name
21 ENV{DM_NAME}=="?*", NAME="mapper/$env{DM_NAME}"
22
23 SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
24
25 PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end"
26 RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end"
27
28 IMPORT{program}="vol_id --export $tempnode"
29 OPTIONS="link_priority=50"
30 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_SAFE}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_SAFE}"
31 ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
32
33 LABEL="device_mapper_end"