chiark / gitweb /
move default rules from /etc/udev/rules.d/ to /lib/udev/rules.d/
[elogind.git] / rules / debian / 60-persistent-storage-tape.rules
1 # This file contains the rules needed to create persistent device names.
2
3 # we are only interested in add and change actions for block devices
4 ACTION!="add|change",                   GOTO="persistent_storage_tape_end"
5
6 # "Medium Changers"
7 KERNEL=="sg[0-9]*", \
8         SUBSYSTEMS=="scsi", ATTRS{type}=="8", \
9         IMPORT{program}="scsi_id --export --sg-version=3 --whitelisted --device=$tempnode"
10
11 KERNEL=="sg[0-9]*", ATTRS{type}=="8",   ENV{ID_SERIAL}=="?*", \
12         SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
13
14 SUBSYSTEM!="scsi_tape",                 GOTO="persistent_storage_tape_end"
15
16 KERNEL=="st*[0-9]|nst*[0-9]",           ATTRS{ieee1394_id}=="?*", \
17         ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}"
18 KERNEL=="st*[0-9]|nst*[0-9]",           ENV{ID_SERIAL}!="?*", \
19         SUBSYSTEMS=="usb", \
20         IMPORT{program}="usb_id --export $devpath"
21
22 KERNEL=="st*[0-9]|nst*[0-9]",           ENV{ID_SERIAL}!="?*", \
23         SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", \
24         ENV{BSG_DEV}="$root/bsg/$id"
25 KERNEL=="st*[0-9]|nst*[0-9]",           ENV{ID_SERIAL}!="?*", \
26         WAIT_FOR="$env{BSG_DEV}", \
27         ENV{ID_BUS}="scsi", \
28         IMPORT{program}="scsi_id --export --device=$env{BSG_DEV}"
29
30 KERNEL=="st*[0-9]",                     ENV{ID_SERIAL}=="?*", \
31         SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
32 KERNEL=="nst*[0-9]",                    ENV{ID_SERIAL}=="?*", \
33         SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
34
35 KERNEL=="st*[0-9]|nst*[0-9]", \
36         IMPORT{program}="path_id $devpath"
37 KERNEL=="st*[0-9]",                     ENV{ID_PATH}=="?*", \
38         SYMLINK+="tape/by-path/$env{ID_PATH}"
39 KERNEL=="nst*[0-9]",                    ENV{ID_PATH}=="?*", \
40         SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
41
42 # end of processing
43 LABEL="persistent_storage_tape_end"
44