# /etc/udev/udev.rules:  device naming rules for udev
#
# There are a number of modifiers that are allowed to be used in some
# of the different fields. They provide the following subsitutions:
# %n - the "kernel number" of the device.
#      For example, 'sda3' has a "kernel number" of '3'
# %k - the kernel name for the device.
# %M - the kernel major number for the device
# %m - the kernel minor number for the device
# %b - the bus id for the device
# %c - the string returned by the PROGRAM. (Note, this doesn't work within
#      the PROGRAM field for the obvious reason.)
# %s{filename} - the content of a sysfs attribute.
# %% - the '%' char itself.
#

# permissions for IDE CD devices
BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom*", NAME="%k", GROUP="cdrom", MODE="0660"

# permissions for IDE floppy devices
BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="floppy*", NAME="%k", GROUP="floppy", MODE="0660"

# permissions for SCSI cd/sg/tape devices
BUS="scsi", KERNEL="s[grt][0-9]*", SYSFS_type="5", NAME="%k", GROUP="cdrom", MODE="0660"

# DRI devices
KERNEL="card*", NAME="dri/card%n"

# ALSA devices
KERNEL="controlC[0-9]*", NAME="snd/%k"
KERNEL="hw[CD0-9]*",     NAME="snd/%k"
KERNEL="pcm[CD0-9cp]*",  NAME="snd/%k"
KERNEL="midiC[D0-9]*",   NAME="snd/%k"
KERNEL="timer",          NAME="snd/%k"
KERNEL="seq",            NAME="snd/%k"

# dm devices (ignore them)
KERNEL="dm-[0-9]*",     NAME=""
# create a symlink named after the device map name
# note devmap_name comes with extras/multipath
#KERNEL="dm-[0-9]*",     PROGRAM="/etc/udev/scripts/devmap_name %M %m", NAME="%k", SYMLINK="%c"
KERNEL="device-mapper", NAME="mapper/control"

# fb devices
KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"

# floppy devices
KERNEL="fd[0-9]*", NAME="floppy/%n", SYMLINK="%k", PROGRAM="/etc/udev/scripts/floppy-extra-devs.sh %k %b %n"

# i2c devices
KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"

# input devices
KERNEL="mice",		NAME="input/%k"
KERNEL="mouse*",	NAME="input/%k"
KERNEL="event*",	NAME="input/%k"
KERNEL="js*",		NAME="input/%k"
KERNEL="ts*",		NAME="input/%k"

# loop devices
KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"

# md block devices
KERNEL="md[0-9]*", NAME="md/%n", SYMLINK="%k"

# misc devices
KERNEL="rtc",     NAME="misc/%k", SYMLINK="%k"
KERNEL="psaux",   NAME="misc/%k", SYMLINK="%k"
KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k"
KERNEL="uinput",  NAME="misc/%k", SYMLINK="%k"

# pty devices
KERNEL="pty[p-za-e][0-9a-f]*", NAME="pty/m%n", SYMLINK="%k"
KERNEL="tty[p-za-e][0-9a-f]*", NAME="tty/s%n", SYMLINK="%k"

# ramdisk devices
KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"

# sound devices
KERNEL="adsp",            NAME="sound/%k", SYMLINK="%k"
KERNEL="adsp[0-9]*",      NAME="sound/%k", SYMLINK="%k"
KERNEL="audio",           NAME="sound/%k", SYMLINK="%k"
KERNEL="audio[0-9]*",     NAME="sound/%k", SYMLINK="%k"
KERNEL="dsp",             NAME="sound/%k", SYMLINK="%k"
KERNEL="dsp[0-9]*",       NAME="sound/%k", SYMLINK="%k"
KERNEL="mixer",           NAME="sound/%k", SYMLINK="%k"
KERNEL="mixer[0-9]*",     NAME="sound/%k", SYMLINK="%k"
KERNEL="sequencer",       NAME="sound/%k", SYMLINK="%k"
KERNEL="sequencer[0-9]*", NAME="sound/%k", SYMLINK="%k"

# tty devices
KERNEL="tty[0-9]*",    NAME="vc/%n",  SYMLINK="%k"
KERNEL="ttyS[0-9]*",   NAME="tts/%n", SYMLINK="%k"
KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"

# vc devices
KERNEL="vcs",        NAME="vcc/0",   SYMLINK="%k"
KERNEL="vcs[0-9]*",  NAME="vcc/%n",  SYMLINK="%k"
KERNEL="vcsa",       NAME="vcc/a0",  SYMLINK="%k"
KERNEL="vcsa[0-9]*", NAME="vcc/a%n", SYMLINK="%k"

# v4l devices
KERNEL="video[0-9]*", NAME="v4l/video%n", SYMLINK="%k"
KERNEL="radio[0-9]*", NAME="v4l/radio%n", SYMLINK="%k"
KERNEL="vbi[0-9]*",   NAME="v4l/vbi%n",   SYMLINK="%k"
KERNEL="vtx[0-9]*",   NAME="v4l/vtx%n",   SYMLINK="%k"

# USB devices
KERNEL="hiddev*",	NAME="usb/%k"
KERNEL="auer*",		NAME="usb/%k"
KERNEL="legousbtower*",	NAME="usb/%k"
KERNEL="dabusb*",	NAME="usb/%k"
BUS="usb", KERNEL="lp[0-9]*",	NAME="usb/%k"

# Network devices
KERNEL="tap*",		NAME="net/%k"
KERNEL="tun",		NAME="net/%k"

# CAPI devices
KERNEL="capi",		NAME="capi20", SYMLINK="isdn/capi20"
KERNEL="capi*",		NAME="capi/%n"

# raw devices
KERNEL="raw[0-9]*",     NAME="raw/%k" 
