chiark / gitweb /
update Gentoo rules
[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-*", ACTION=="add|change", GOTO="device_mapper_do"
7 GOTO="device_mapper_end"
8 LABEL="device_mapper_do"
9
10 # lookup device name
11 # use dmsetup, until devmap_name is provided by sys-fs/device-mapper
12 PROGRAM=="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info",
13         ENV{ID_DM_NAME}="%c"
14
15 # do not do anything if dmsetup does not provide a name
16 ENV{ID_DM_NAME}=="", NAME="", OPTIONS="ignore_device"
17
18 # ignore luks crypt devices while not fully up
19 ENV{ID_DM_NAME}=="temporary-cryptsetup-*", NAME="", OPTIONS="ignore_device"
20
21 # use queried name
22 ENV{ID_DM_NAME}=="?*", NAME="mapper/$env{ID_DM_NAME}"
23
24 PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end"
25 RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end"
26
27 IMPORT{program}="vol_id --export $tempnode"
28 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}", OPTIONS="link_priority=50"
29 ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}", OPTIONS="link_priority=50"
30
31 LABEL="device_mapper_end"