chiark / gitweb /
update Debian rules
[elogind.git] / etc / udev / debian / persistent.rules
1 # This file contains the rules needed to create persistent device names.
2
3 # we are only interested in add actions for block devices
4 SUBSYSTEM!="block",                     GOTO="no_volume_id"
5 ACTION!="add",                          GOTO="no_volume_id"
6
7 # and we can safely ignore these kinds of devices
8 KERNEL=="ram*|loop*|fd*|nbd*",          GOTO="no_volume_id"
9
10 # skip removable ide devices, because open(2) on them causes an events loop
11 BUS=="ide", SYSFS{removable}=="1",      GOTO="no_volume_id"
12 BUS=="ide", SYSFS{../removable}=="1",   GOTO="no_volume_id"
13
14 # disk id
15 KERNEL=="hd*[!0-9]", \
16         IMPORT{program}="/sbin/ata_id --export $tempnode"
17
18 KERNEL=="sd*[!0-9]|sr*",                SYSFS{ieee1394_id}=="*", \
19         IMPORT{program}="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394'"
20 KERNEL=="sd*[!0-9]|sr*",                ENV{ID_SERIAL}=="", \
21         IMPORT{program}="/sbin/usb_id -x"
22 KERNEL=="sd*[!0-9]|sr*",                ENV{ID_SERIAL}=="", \
23         IMPORT{program}="/sbin/scsi_id -g -x -s %p -d %N"
24 KERNEL=="sd*[!0-9]|sr*",                ENV{ID_SERIAL}=="", \
25         IMPORT{program}="/sbin/scsi_id -g -x -a -s %p -d %N"
26
27 KERNEL=="dasd*[!0-9]", \
28         IMPORT{program}="/sbin/dasd_id --export $tempnode"
29
30 KERNEL=="hd*[0-9]|sd*[0-9]|dasd*[0-9]", IMPORT{parent}="ID_*"
31 KERNEL=="hd*[!0-9]",                    ENV{ID_SERIAL}=="?*", \
32         SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
33 KERNEL=="sd*[!0-9]|sr*|dasd[!0-9]*",    ENV{ID_SERIAL}=="?*", \
34         SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
35 KERNEL=="hd*[0-9]",                     ENV{ID_SERIAL}=="?*", \
36         SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
37 KERNEL=="sd*[0-9]|dasd*[0-9]",          ENV{ID_SERIAL}=="?*", \
38         SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
39
40 # path
41 KERNEL=="*[!0-9]|sr*",                  ENV{ID_TYPE}=="?*", \
42         IMPORT{program}="/sbin/path_id %p",
43
44 KERNEL=="*[0-9]",                       IMPORT{parent}="ID_*"
45 KERNEL=="*[!0-9]|sr*",                  ENV{ID_PATH}=="?*", \
46         SYMLINK+="disk/by-path/$env{ID_PATH}"
47 KERNEL=="*[0-9]",                       ENV{ID_PATH}=="?*", \
48         SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
49
50 # UUID and volume label
51 KERNEL=="*[!0-9]|sr*", SYSFS{removable}=="1", GOTO="no_volume_id"
52 IMPORT{program}="/sbin/vol_id --export $tempnode"
53 ENV{ID_FS_UUID}=="?*",          SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
54 ENV{ID_FS_LABEL_SAFE}=="?*",    SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
55
56 # end of processing
57 LABEL="no_volume_id"
58