[7e161ea] | 1 | ########################################################################
|
---|
| 2 | #
|
---|
[26b1cc1] | 3 | # Description : 60-persistent-disk.rules
|
---|
[7e161ea] | 4 | #
|
---|
| 5 | # Authors : Based on Open Suse Udev Rules
|
---|
| 6 | # kay.sievers@suse.de and hare@suse.de
|
---|
| 7 | #
|
---|
| 8 | # Adapted to : Jim Gifford
|
---|
| 9 | # LFS
|
---|
| 10 | #
|
---|
| 11 | # Version : 00.01
|
---|
| 12 | #
|
---|
| 13 | # Notes :
|
---|
| 14 | #
|
---|
| 15 | ########################################################################
|
---|
| 16 |
|
---|
| 17 | # persistent disk links: /dev/disk/{by-id,by-uuid,by-label,by-path}
|
---|
| 18 | # scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
|
---|
| 19 |
|
---|
[bda8cfb] | 20 | ACTION!="add", GOTO="persistent_storage_end"
|
---|
| 21 | SUBSYSTEM!="block", GOTO="persistent_storage_end"
|
---|
[7e161ea] | 22 |
|
---|
| 23 | # skip rules for inappropriate block devices
|
---|
[bda8cfb] | 24 | KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_storage_end"
|
---|
| 25 |
|
---|
| 26 | # Set Permissions on CDOM
|
---|
[e7b5340] | 27 | BUS=="ide", DRIVERS=="ide-cdrom", ATTRS{removable}=="1", GROUP="cdrom", MODE="660"
|
---|
[7e161ea] | 28 |
|
---|
| 29 | # never access removable ide devices, the drivers are causing event loops on open()
|
---|
[bda8cfb] | 30 | KERNEL=="hd*[!0-9]", ATTRS{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
|
---|
| 31 | KERNEL=="hd*[0-9]", ATTRS{../removable}=="1", GOTO="persistent_storage_end"
|
---|
[7e161ea] | 32 |
|
---|
| 33 | # by-id (hardware serial number)
|
---|
[dfdebf6] | 34 | KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
|
---|
[1f7827a2] | 35 | KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
|
---|
| 36 | KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
|
---|
[7e161ea] | 37 |
|
---|
[bda8cfb] | 38 | KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
|
---|
[dfdebf6] | 39 | KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
|
---|
| 40 | KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
|
---|
| 41 | KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
|
---|
| 42 | KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
|
---|
[1f7827a2] | 43 | KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
|
---|
[7e161ea] | 44 |
|
---|
| 45 | # for partitions import parent information
|
---|
[1f7827a2] | 46 | KERNEL=="sd*[0-9]|dasd*[0-9]", IMPORT{parent}=="ID_*"
|
---|
| 47 | KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
|
---|
[7e161ea] | 48 |
|
---|
| 49 | # by-path (shortest physical path)
|
---|
[dfdebf6] | 50 | KERNEL=="*[!0-9]|sr*", ENV{ID_TYPE}=="?*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
|
---|
[bda8cfb] | 51 | KERNEL=="sr*", GOTO="persistent_storage_end"
|
---|
[1f7827a2] | 52 | KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
|
---|
| 53 | KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
|
---|
[7e161ea] | 54 |
|
---|
| 55 | # by-label/by-uuid (filesystem properties)
|
---|
[bda8cfb] | 56 | KERNEL=="*[!0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
|
---|
[dfdebf6] | 57 | IMPORT{program}="vol_id --export $tempnode"
|
---|
[1f7827a2] | 58 | ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
|
---|
| 59 | ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
|
---|
[7e161ea] | 60 |
|
---|
| 61 | # BIOS Enhanced Disk Device
|
---|
[dfdebf6] | 62 | KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
|
---|
[1f7827a2] | 63 | KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
|
---|
| 64 | KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
|
---|
[7e161ea] | 65 |
|
---|
[a66f0df] | 66 | KERNEL=="dm-[0-9]*", ACTION=="add", PROGRAM="/sbin/dmsetup info -c --noopencount --noheadings -o name -j %M -m %m", SYMLINK+="disk/by-name/%c"
|
---|
[7e161ea] | 67 |
|
---|
[bda8cfb] | 68 | LABEL="persistent_storage_end"
|
---|