]> git.ipfire.org Git - ipfire-2.x.git/blame - config/install/udev/rules.d/60-persistent-storage.rules
kernel: update (2.6.32.17).
[ipfire-2.x.git] / config / install / udev / rules.d / 60-persistent-storage.rules
CommitLineData
e001bff3
MT
1# persistent storage links: /dev/{disk,tape}/{by-id,by-uuid,by-label,by-path,by-name}
2# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
3
4ACTION!="add", GOTO="persistent_storage_end"
5SUBSYSTEM!="block", GOTO="persistent_storage_end"
6
7# skip rules for inappropriate block devices
8KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_storage_end"
9
10# never access removable ide devices, the drivers are causing event loops on open()
11KERNEL=="hd*[!0-9]", SYSFS{removable}=="1", DRIVER=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
12KERNEL=="hd*[0-9]", SYSFS{../removable}=="1", GOTO="persistent_storage_end"
13
14# for partitions import parent information
15KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
16
17# by-id (hardware serial number)
18KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
19KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
20KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
21
22KERNEL=="sd*[!0-9]|sr*|st*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394"
23KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
24KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
25KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
26KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
27KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
28KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
29KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
30
31# by-path (shortest physical path)
32KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
33KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
34KERNEL=="sr*|st*", GOTO="persistent_storage_end"
35KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
36
37# by-label/by-uuid (filesystem properties)
38KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_storage_end"
39IMPORT{program}="vol_id --export $tempnode"
40ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
41ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
42
43# BIOS Enhanced Disk Device
44KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
45KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
46KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
47
48
49LABEL="persistent_storage_end"