Annotation of /trunk/udev/config-udev-103-r2/udev-persistent-storage.rules.magellan
Parent Directory | Revision Log
Revision 89 -
(hide annotations)
(download)
Tue Dec 26 12:34:36 2006 UTC (17 years, 5 months ago) by niro
File size: 3039 byte(s)
Tue Dec 26 12:34:36 2006 UTC (17 years, 5 months ago) by niro
File size: 3039 byte(s)
import
1 | niro | 89 | # /etc/udev/rules/65-persistent-storage.rules: device naming rules for udev |
2 | # $Header: /root/magellan-cvs/src/udev/config-udev-103-r2/udev-persistent-storage.rules.magellan,v 1.1 2006-12-26 12:34:32 niro Exp $ | ||
3 | |||
4 | # persistent storage links: /dev/{disk,tape}/{by-id,by-uuid,by-label,by-path,by-name} | ||
5 | # scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de> | ||
6 | |||
7 | ACTION!="add", GOTO="persistent_storage_end" | ||
8 | SUBSYSTEM!="block", GOTO="persistent_storage_end" | ||
9 | |||
10 | # skip rules for inappropriate block devices | ||
11 | KERNEL=="ram*|loop*|fd*|nbd*|dm-*", GOTO="persistent_storage_end" | ||
12 | |||
13 | # never access non-cdrom removable ide devices, the drivers are causing event loops on open() | ||
14 | KERNEL=="hd*[!0-9]", ATTRS{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end" | ||
15 | KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end" | ||
16 | |||
17 | # for partitions import parent information | ||
18 | KERNEL=="*[0-9]", IMPORT{parent}=="ID_*" | ||
19 | |||
20 | # by-id (hardware serial number) | ||
21 | KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode" | ||
22 | KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" | ||
23 | KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" | ||
24 | |||
25 | KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" | ||
26 | KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x" | ||
27 | KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" | ||
28 | KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" | ||
29 | KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode" | ||
30 | KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" | ||
31 | KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" | ||
32 | KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" | ||
33 | |||
34 | # by-path (shortest physical path) | ||
35 | KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}" | ||
36 | KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}" | ||
37 | KERNEL=="sr*|st*", GOTO="persistent_storage_end" | ||
38 | KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" | ||
39 | |||
40 | # by-label/by-uuid (filesystem properties) | ||
41 | KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end" | ||
42 | IMPORT{program}="vol_id --export $tempnode" | ||
43 | ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" | ||
44 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" | ||
45 | |||
46 | # BIOS Enhanced Disk Device | ||
47 | KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode" | ||
48 | KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}" | ||
49 | KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n" | ||
50 | |||
51 | LABEL="persistent_storage_end" |