]>
Commit | Line | Data |
---|---|---|
1532b47b MS |
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 | ||
54b813ba MS |
6 | KERNEL!="dm-*", GOTO="device_mapper_end" |
7 | ACTION!="add|change", GOTO="device_mapper_end" | |
1532b47b MS |
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", | |
564794bb | 12 | ENV{DM_NAME}="%c" |
1532b47b MS |
13 | |
14 | # do not do anything if dmsetup does not provide a name | |
564794bb | 15 | ENV{DM_NAME}=="", NAME="", OPTIONS="ignore_device" |
1532b47b MS |
16 | |
17 | # ignore luks crypt devices while not fully up | |
564794bb | 18 | ENV{DM_NAME}=="temporary-cryptsetup-*", NAME="", OPTIONS="ignore_device" |
1532b47b MS |
19 | |
20 | # use queried name | |
564794bb MS |
21 | ENV{DM_NAME}=="?*", NAME="mapper/$env{DM_NAME}" |
22 | ||
23 | SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" | |
1532b47b MS |
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" | |
54b813ba | 29 | OPTIONS="link_priority=50" |
564794bb | 30 | ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_SAFE}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_SAFE}" |
54b813ba | 31 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" |
1532b47b MS |
32 | |
33 | LABEL="device_mapper_end" |