2004-03-03 07:21:03 +03:00
# There are a number of modifiers that are allowed to be used in some of the
# fields. See the udev man page for a full description of them.
#
2005-08-09 13:58:11 +04:00
# default is OWNER="root" GROUP="root", MODE="0600"
2004-03-03 07:21:03 +03:00
#
2005-09-18 07:37:33 +04:00
KERNEL="*", OWNER="root" GROUP="root", MODE="0600"
2004-03-03 07:21:03 +03:00
2005-04-19 01:59:43 +04:00
# all block devices
SUBSYSTEM=="block", GROUP="disk", MODE="0640"
2005-09-18 07:37:33 +04:00
KERNEL=="root", GROUP="disk", MODE="0640"
2005-04-19 01:59:43 +04:00
# console devices
2005-09-18 07:37:33 +04:00
KERNEL=="tty", MODE="0666", OPTIONS="last_rule"
2005-12-04 04:52:57 +03:00
KERNEL=="console", MODE="0600", OPTIONS="last_rule"
2005-09-18 07:37:33 +04:00
KERNEL=="tty[0-9]", GROUP="tty", MODE="0660", OPTIONS="last_rule"
KERNEL=="tty[0-9][0-9]*", GROUP="tty", MODE="0660", OPTIONS="last_rule"
KERNEL=="vc/[0-9]*", GROUP="tty", MODE="0660", OPTIONS="last_rule"
2005-04-19 01:59:43 +04:00
# pty devices
# Set this to 0660 if you only want users belonging to tty group
# to be able to allocate PTYs
2005-09-18 07:37:33 +04:00
KERNEL=="ptmx", GROUP="tty", MODE="0666", OPTIONS="last_rule"
KERNEL=="pty[p-za-e][0-9a-f]*", GROUP="tty", MODE="0660", OPTIONS="last_rule"
KERNEL=="tty[p-za-e][0-9a-f]*", GROUP="tty", MODE="0660", OPTIONS="last_rule"
KERNEL=="pty/m*", GROUP="tty", MODE="0660", OPTIONS="last_rule"
KERNEL=="vc/s*", GROUP="tty", MODE="0660", OPTIONS="last_rule"
2005-04-19 01:59:43 +04:00
# serial+dialup devices
2005-09-18 07:37:33 +04:00
KERNEL=="ttyS*", GROUP="uucp", MODE="0660", OPTIONS="last_rule"
KERNEL=="ttyACM*", GROUP="uucp", MODE="0660", OPTIONS="last_rule"
KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660", OPTIONS="last_rule"
2005-04-19 01:59:43 +04:00
KERNEL=="ippp*", MODE="0660"
KERNEL=="isdn*", MODE="0660"
KERNEL=="isdnctrl*", MODE="0660"
KERNEL=="capi*", MODE="0660"
KERNEL=="dcbri*", MODE="0660"
KERNEL=="ircomm*", GROUP="uucp", MODE="0660"
KERNEL=="tts/[0-9]*", GROUP="uucp", MODE="0660"
KERNEL=="tts/USB[0-9]*", GROUP="uucp", MODE="0660"
# vc devices
2005-12-04 04:52:57 +03:00
KERNEL=="vcs", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
KERNEL=="vcs[0-9]*", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
KERNEL=="vcsa", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
KERNEL=="vcsa[0-9]*", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
2005-04-19 01:59:43 +04:00
# memory devices
2005-12-04 04:52:57 +03:00
KERNEL=="random", MODE="0666", OPTIONS="last_rule"
KERNEL=="urandom", MODE="0444", OPTIONS="last_rule"
KERNEL=="mem", GROUP="kmem", MODE="0640", OPTIONS="last_rule"
KERNEL=="kmem", GROUP="kmem", MODE="0640", OPTIONS="last_rule"
KERNEL=="port", GROUP="kmem", MODE="0640", OPTIONS="last_rule"
KERNEL=="full", MODE="0666", OPTIONS="last_rule"
KERNEL=="null", MODE="0666", OPTIONS="last_rule"
KERNEL=="zero", MODE="0666", OPTIONS="last_rule"
2005-04-19 01:59:43 +04:00
# misc devices
KERNEL=="nvram", MODE="0660"
KERNEL=="rtc", MODE="0644"
# floppy devices
KERNEL=="fd[01]*", GROUP="floppy", MODE="0660"
# audio devices
KERNEL=="dsp*", MODE="0660"
KERNEL=="audio*", MODE="0660"
KERNEL=="midi*", MODE="0660"
KERNEL=="mixer*", MODE="0660"
KERNEL=="sequencer*", MODE="0660"
KERNEL=="sound/*", MODE="0660"
KERNEL=="snd/*", MODE="0660"
KERNEL=="beep", MODE="0660"
KERNEL=="admm*", MODE="0660"
KERNEL=="adsp*", MODE="0660"
KERNEL=="aload*", MODE="0660"
KERNEL=="amidi*", MODE="0660"
KERNEL=="dmfm*", MODE="0660"
KERNEL=="dmmidi*", MODE="0660"
KERNEL=="sndstat", MODE="0660"
# pilot/palm devices
KERNEL=="pilot", GROUP="uucp", MODE="0660"
# lp devices
KERNEL=="lp*", GROUP="lp", MODE="0660"
KERNEL=="parport*", GROUP="lp", MODE="0660"
KERNEL=="irlpt*", GROUP="lp", MODE="0660"
KERNEL=="usblp*", GROUP="lp", MODE="0660"
KERNEL=="usb/lp*", GROUP="lp", MODE="0660"
# tape devices
2005-08-09 13:58:11 +04:00
KERNEL=="ht*", GROUP="disk", MODE="0660"
KERNEL=="nht*", GROUP="disk", MODE="0660"
KERNEL=="pt[0-9]*", GROUP="disk", MODE="0660"
KERNEL=="npt*", GROUP="disk", MODE="0660"
KERNEL=="st*", GROUP="disk", MODE="0660"
KERNEL=="nst*", GROUP="disk", MODE="0660"
KERNEL=="osst*", GROUP="disk", MODE="0660"
KERNEL=="nosst*", GROUP="disk", MODE="0660"
2005-04-19 01:59:43 +04:00
# diskonkey devices
KERNEL=="diskonkey*", GROUP="disk", MODE="0640"
# rem_ide devices
KERNEL=="microdrive*", GROUP="disk", MODE="0640"
# kbd devices
KERNEL=="kbd", MODE="0644"
# joystick devices
KERNEL=="js[0-9]*", MODE="0644"
KERNEL=="djs[0-9]*", MODE="0644"
# v4l devices
KERNEL=="video*", MODE="0660"
KERNEL=="radio*", MODE="0660"
KERNEL=="winradio*", MODE="0660"
KERNEL=="vtx*", MODE="0660"
KERNEL=="vbi*", MODE="0660"
KERNEL=="video/*", MODE="0660"
KERNEL=="vttuner", MODE="0660"
KERNEL=="v4l/*", MODE="0660"
# input devices
2005-05-19 10:34:45 +04:00
KERNEL=="input/*", MODE="0660"
2005-04-19 01:59:43 +04:00
# gpm devices
KERNEL=="gpmctl", MODE="0700"
# dri devices
KERNEL=="nvidia*", MODE="0660"
KERNEL=="3dfx*", MODE="0660"
KERNEL=="dri/*", MODE="0666"
# usb devices
2005-12-04 04:52:57 +03:00
KERNEL=="usb/dabusb*", MODE="0660"
KERNEL=="usb/mdc800*", MODE="0660"
KERNEL=="usb/rio500", MODE="0660"
2005-04-19 01:59:43 +04:00
# s390 devices
KERNEL=="z90crypt", MODE="0666"
# DVB
KERNEL=="dvb/*", MODE="0660"
KERNEL=="dvb", MODE="0660"
KERNEL=="dvb/adapter*", MODE="0660"
2004-12-18 14:20:41 +03:00
# create a symlink named after the device map name
# note devmap_name comes with extras/multipath
2005-08-09 13:58:11 +04:00
#KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c"
2004-12-19 00:59:21 +03:00
2004-12-18 14:20:41 +03:00
# DRI devices always go into a subdirectory (as per the LSB spec)
2005-04-19 01:59:43 +04:00
KERNEL=="card*", NAME="dri/card%n"
2004-03-03 07:21:03 +03:00
# alsa devices
2005-04-19 01:59:43 +04:00
KERNEL=="controlC[0-9]*", NAME="snd/%k"
KERNEL=="hw[CD0-9]*", NAME="snd/%k"
KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
KERNEL=="midi[CD0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
2004-03-03 07:21:03 +03:00
# input devices
2005-04-19 01:59:43 +04:00
KERNEL=="mice", NAME="input/%k"
KERNEL=="mouse*", NAME="input/%k"
KERNEL=="event*", NAME="input/%k"
2005-12-04 04:52:57 +03:00
KERNEL=="js*", NAME="input/%k", SYMLINK+="%k"
2005-04-19 01:59:43 +04:00
KERNEL=="ts*", NAME="input/%k"
2005-12-04 04:52:57 +03:00
# IEEE1394 (firewire) devices (must be before raw devices below)
KERNEL=="raw1394", NAME="%k"
KERNEL=="dv1394*", NAME="dv1394/%n"
KERNEL=="video1394*", NAME="video1394/%n"
2005-04-19 01:59:43 +04:00
KERNEL=="raw[0-9]*", NAME="raw/%k"
2005-08-09 13:58:11 +04:00
KERNEL=="lp[0-9]*", SYMLINK+="par%n"
2005-04-19 01:59:43 +04:00
BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
KERNEL=="microcode", NAME="cpu/%k"
2005-09-18 07:37:33 +04:00
KERNEL="msr[0-9]*", NAME="cpu/%n/msr"
2005-12-04 04:52:57 +03:00
KERNEL="cpu[0-9]*", NAME="cpu/%n/cpuid"
2005-08-09 13:58:11 +04:00
KERNEL=="ram1", SYMLINK+="ram"
KERNEL=="video0", SYMLINK+="video"
KERNEL=="radio0", SYMLINK+="radio"
KERNEL=="audio0", SYMLINK+="audio"
KERNEL=="dsp0", SYMLINK+="dsp"
KERNEL=="fb0", SYMLINK+="fb"
KERNEL=="qft0", SYMLINK+="ftape"
KERNEL=="isdnctrl0", SYMLINK+="isdnctrl"
KERNEL=="mixer0", SYMLINK+="mixer"
KERNEL=="ram0", SYMLINK+="ramdisk"
KERNEL=="sbpcd0", SYMLINK+="sbpcd"
KERNEL=="radio0", SYMLINK+="radio"
KERNEL=="tty0", SYMLINK+="systty"
KERNEL=="vbi0", SYMLINK+="vbi"
KERNEL=="null", SYMLINK+="XOR"
2005-04-19 01:59:43 +04:00
KERNEL=="tun", NAME="net/%k"
KERNEL=="device-mapper", NAME="mapper/control"
2004-12-18 14:20:41 +03:00
# old compat symlinks with enumeration
2005-08-09 13:58:11 +04:00
KERNEL=="sr[0-9]*", SYMLINK+="cdrom%e"
KERNEL=="scd[0-9]*", SYMLINK+="cdrom%e"
KERNEL=="pcd[0-9]*", SYMLINK+="cdrom%e"
KERNEL=="fd[0-9]*", SYMLINK+="floppy%e"
KERNEL=="nst[0-9]", BUS=="scsi", SYMLINK+="tape%e", MODE="0660"
KERNEL=="nosst[0-9]", BUS=="scsi", SYMLINK+="tape%e", MODE="0660"
KERNEL=="sg[0-9]*", BUS="scsi", SYSFS{type}=="6", SYMLINK+="scanner%e", MODE="0660"
2005-05-19 10:34:45 +04:00
KERNEL=="umad*", NAME="infiniband/%k"
KERNEL=="issm*", NAME="infiniband/%k"
# Section for zaptel device
KERNEL=="zapctl", NAME="zap/ctl"
KERNEL=="zaptimer", NAME="zap/timer"
KERNEL=="zapchannel", NAME="zap/channel"
KERNEL=="zappseudo", NAME="zap/pseudo"
KERNEL=="zap[0-9]*", NAME="zap/%n"
2004-12-21 02:19:34 +03:00
2005-08-09 13:58:11 +04:00
BUS=="scsi", KERNEL=="sg[0-9]*", SYSFS{type}=="6", NAME="%k", SYMLINK="scanner%e", MODE="0660"
2005-04-19 01:59:43 +04:00
# do not seperate the next 2 lines!!
2005-12-04 04:52:57 +03:00
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="/lib/udev/ide-media.sh %k", RESULT=="floppy", SYMLINK+="floppy%e", NAME{ignore_remove, all_partitions}="%k"
2004-12-18 14:20:41 +03:00
2005-08-09 13:58:11 +04:00
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", RESULT=="cdrom", SYMLINK+="cdrom%e"
2004-12-18 14:20:41 +03:00
2005-12-04 04:52:57 +03:00
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="/lib/udev/check-cdrom.sh %k DVD", SYMLINK+="dvd%e"
KERNEL=="sr[0-9]*", BUS=="scsi", PROGRAM=="/lib/udev/check-cdrom.sh %k DVD", SYMLINK+="dvd%e"
2004-12-18 14:20:41 +03:00
2005-12-04 04:52:57 +03:00
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="/lib/udev/check-cdrom.sh %k CD-R", SYMLINK+="cdwriter%e"
KERNEL=="sr[0-9]*", BUS=="scsi", PROGRAM=="/lib/udev/check-cdrom.sh %k CD-R", SYMLINK+="cdwriter%e"
2004-12-18 14:20:41 +03:00
2005-12-04 04:52:57 +03:00
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM="/lib/udev/check-cdrom.sh %k DVD-R", SYMLINK+="dvdwriter%e"
KERNEL=="sr[0-9]*", BUS=="scsi", PROGRAM=="/lib/udev/check-cdrom.sh %k DVD-R", SYMLINK+="dvdwriter%e"
2004-12-18 14:20:41 +03:00
# rename sr* to scd*
2005-04-19 01:59:43 +04:00
KERNEL=="sr[0-9]*", BUS=="scsi", NAME="scd%n"
KERNEL=="hd[a-z]*", BUS=="ide", SYSFS{removable}=="1", NAME{ignore_remove}="%k"
2004-12-18 14:20:41 +03:00
2005-12-04 04:52:57 +03:00
KERNEL=="dvb*", PROGRAM=="/lib/udev/dvb.sh %k", NAME="%c"
2005-08-09 13:58:11 +04:00
2005-09-18 07:37:33 +04:00
#######################################
2005-12-04 04:52:57 +03:00
# Persistent block device stuff - begin
2005-09-18 07:37:33 +04:00
#######################################
2005-12-04 04:52:57 +03:00
# persistent disk links: /dev/disk/{by-id,by-uuid,by-label,by-path}
# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
ACTION!="add", GOTO="persistent_end"
SUBSYSTEM!="block", GOTO="persistent_end"
2005-09-18 07:37:33 +04:00
2005-12-04 04:52:57 +03:00
# skip rules for inappropriate block devices
KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_end"
2005-09-18 07:37:33 +04:00
2005-12-04 04:52:57 +03:00
# never access removable ide devices, the drivers are causing event loops on open()
BUS=="ide", DRIVER!="ide-cdrom", SYSFS{removable}="1", GOTO="persistent_end"
2005-09-18 07:37:33 +04:00
2005-12-04 04:52:57 +03:00
# by-id (hardware serial number)
KERNEL=="hd*[!0-9]", IMPORT{program}="/sbin/ata_id --export $tempnode"
2005-09-18 07:37:33 +04:00
KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
2005-12-04 04:52:57 +03:00
KERNEL=="sd*[!0-9]|sr*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394"
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/usb_id -x"
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -s %p -d $tempnode"
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -a -s %p -d $tempnode"
KERNEL=="dasd*[!0-9]", IMPORT{program}="/sbin/dasd_id --export $tempnode"
KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
2005-09-18 07:37:33 +04:00
2005-12-04 04:52:57 +03:00
# for partitions import parent information
KERNEL=="sd*[0-9]|dasd*[0-9]", IMPORT{parent}=="ID_*"
KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
2005-09-18 07:37:33 +04:00
2005-12-04 04:52:57 +03:00
# by-path (shortest physical path)
KERNEL=="*[!0-9]|sr*", ENV{ID_TYPE}=="?*", IMPORT{program}="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
KERNEL=="sr*", GOTO="persistent_end"
2005-09-18 07:37:33 +04:00
KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
2005-12-04 04:52:57 +03:00
# by-label/by-uuid (filesystem properties)
KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_end"
IMPORT{program}="/sbin/vol_id --export $tempnode"
ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
# BIOS Enhanced Disk Device
KERNEL=="*[!0-9]", IMPORT{program}="/sbin/edd_id --export $tempnode"
KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
2005-09-18 07:37:33 +04:00
LABEL="persistent_end"
#####################################
2005-12-04 04:52:57 +03:00
# Persistent block device stuff - end
2005-09-18 07:37:33 +04:00
#####################################
2005-12-04 04:52:57 +03:00
ACTION=="add", SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
2005-09-18 07:37:33 +04:00
2005-08-09 13:58:11 +04:00
# Perhaps this should just be for all subsystems?
ACTION=="add", SUBSYSTEM=="pci", MODALIAS=="*", \
RUN+="/sbin/modprobe $modalias"
ACTION=="add", SUBSYSTEM=="usb", MODALIAS=="*", \
RUN+="/sbin/modprobe $modalias"
ACTION=="add", SUBSYSTEM=="pcmcia", MODALIAS=="*", \
RUN+="/sbin/modprobe $modalias"
ACTION=="add", SUBSYSTEM=="pcmcia", MODALIAS=="*", \
RUN+="/bin/sh -c 'echo 1 > /sys/$DEVPATH/allow_func_id_match'"
ACTION=="add", SUBSYSTEM=="ieee1394", MODALIAS=="*", \
RUN+="/sbin/modprobe $modalias"
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
RUN+="/sbin/modprobe sd_mod"
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="14", \
RUN+="/sbin/modprobe sd_mod"
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[45]", \
RUN+="/sbin/modprobe sr_mod"
2005-12-04 04:52:57 +03:00
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="On[sS]tream", \
2005-08-09 13:58:11 +04:00
SYSFS{model}!="ADR*", RUN+="/sbin/modprobe osst"
2005-12-04 04:52:57 +03:00
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="On[sS]tream", \
2005-08-09 13:58:11 +04:00
SYSFS{model}=="ADR*", RUN+="/sbin/modprobe st"
2005-12-04 04:52:57 +03:00
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}!="On[sS]tream", \
2005-08-09 13:58:11 +04:00
RUN+="/sbin/modprobe st"
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[23689]", \
RUN+="/sbin/modprobe sg"
2005-09-18 07:37:33 +04:00
ACTION=="add", SUBSYSTEM=="firmware", ENV{FIRMWARE}=="*", \
2005-08-09 13:58:11 +04:00
RUN+="/sbin/firmware_helper"