source: udev/60-persistent-disk.rules@ d4fc61c

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since d4fc61c was 1400499, checked in by Jim Gifford <clfs@…>, 18 years ago

Updated to current standards

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[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]20ACTION!="add", GOTO="persistent_storage_end"
21SUBSYSTEM!="block", GOTO="persistent_storage_end"
[7e161ea]22
23# skip rules for inappropriate block devices
[1400499]24KERNEL=="ram*|loop*|fd*|nbd*|dm-*", GOTO="persistent_storage_end"
[bda8cfb]25
26# Set Permissions on CDOM
[e7b5340]27BUS=="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()
[1400499]30KERNEL=="hd*[!0-9]", ATTRS{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
31KERNEL=="hd*[0-9]", ATTRS{../removable}=="1", GOTO="persistent_storage_end"
32
33# for partitions import parent information
34KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
[7e161ea]35
36# by-id (hardware serial number)
[dfdebf6]37KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
[1f7827a2]38KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
39KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
[7e161ea]40
[1400499]41KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
42KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
43KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
44KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
45KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
46KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
47KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
48KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
[7e161ea]49
50# by-path (shortest physical path)
[1400499]51KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
52KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
53KERNEL=="sr*|st*", GOTO="persistent_storage_end"
54KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
[7e161ea]55
56# by-label/by-uuid (filesystem properties)
[1400499]57KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
[dfdebf6]58IMPORT{program}="vol_id --export $tempnode"
[1400499]59ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
60ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
[7e161ea]61
62# BIOS Enhanced Disk Device
[1400499]63KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
64KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
65KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
[7e161ea]66
[bda8cfb]67LABEL="persistent_storage_end"
Note: See TracBrowser for help on using the repository browser.