Annotation of /trunk/udev/udev-device-mapper.rules.magellan
Parent Directory | Revision Log
Revision 191 -
(hide annotations)
(download)
Thu May 17 19:25:02 2007 UTC (17 years, 4 months ago) by niro
File size: 2163 byte(s)
Thu May 17 19:25:02 2007 UTC (17 years, 4 months ago) by niro
File size: 2163 byte(s)
-moved device-mapper rules to an extra file
1 | niro | 191 | # /etc/udev/rules/64-device-mapper.rules: device naming rules for udev |
2 | # $Header: /root/magellan-cvs/src/udev/udev-device-mapper.rules.magellan,v 1.1 2007-05-17 19:25:02 niro Exp $ | ||
3 | # | ||
4 | # There are a number of modifiers that are allowed to be used in some | ||
5 | # of the different fields. They provide the following subsitutions: | ||
6 | # %n - the "kernel number" of the device. | ||
7 | # For example, 'sda3' has a "kernel number" of '3' | ||
8 | # %k - the kernel name for the device. | ||
9 | # %M - the kernel major number for the device | ||
10 | # %m - the kernel minor number for the device | ||
11 | # %b - the bus id for the device | ||
12 | # %c - the string returned by the PROGRAM. (Note, this doesn't work within | ||
13 | # the PROGRAM field for the obvious reason.) | ||
14 | # %s{filename} - the content of a sysfs attribute. | ||
15 | # %% - the '%' char itself. | ||
16 | # | ||
17 | # Try not to modify this file, if you wish to change things, create a new rule | ||
18 | # file that can be run before this one. | ||
19 | # | ||
20 | |||
21 | # device mapper links hook into "change" events, when the dm table | ||
22 | # becomes available; some table-types must be ignored | ||
23 | |||
24 | KERNEL=="device-mapper", NAME="mapper/control" | ||
25 | |||
26 | KERNEL!="dm-*", GOTO="device_mapper_end" | ||
27 | ACTION!="add|change", GOTO="device_mapper_end" | ||
28 | |||
29 | # lookup device name | ||
30 | # use dmsetup, until devmap_name is provided by sys-fs/device-mapper | ||
31 | PROGRAM=="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info", | ||
32 | ENV{DM_NAME}="%c" | ||
33 | |||
34 | # do not do anything if dmsetup does not provide a name | ||
35 | ENV{DM_NAME}=="", NAME="", OPTIONS="ignore_device" | ||
36 | |||
37 | # ignore luks crypt devices while not fully up | ||
38 | ENV{DM_NAME}=="temporary-cryptsetup-*", NAME="", OPTIONS="ignore_device" | ||
39 | |||
40 | # use queried name | ||
41 | ENV{DM_NAME}=="?*", NAME="mapper/$env{DM_NAME}" | ||
42 | |||
43 | SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" | ||
44 | |||
45 | PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end" | ||
46 | RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end" | ||
47 | |||
48 | IMPORT{program}="vol_id --export $tempnode" | ||
49 | OPTIONS="link_priority=50" | ||
50 | ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_SAFE}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_SAFE}" | ||
51 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" | ||
52 | |||
53 | LABEL="device_mapper_end" |