158 lines
5.4 KiB
Plaintext
158 lines
5.4 KiB
Plaintext
![]() |
# /etc/udev/rules/50-udev.rules - crux udev device naming rules
|
||
|
|
||
|
|
||
|
# block devices get assigned to the "disk" group
|
||
|
SUBSYSTEM=="block", GROUP="disk"
|
||
|
|
||
|
# useful cdrom symlinks
|
||
|
BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
|
||
|
BUS=="scsi", KERNEL=="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
|
||
|
BUS=="scsi", KERNEL=="scd[0-9]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
|
||
|
ENV{ID_CDROM}=="?*", SYMLINK+="cdrom%e"
|
||
|
ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw%e"
|
||
|
ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd%e"
|
||
|
ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+=dvdrw%e"
|
||
|
|
||
|
# devfs-style symlinks as well (ide-devfs.sh returns 3 items, we only want the first 2)
|
||
|
BUS=="ide", KERNEL=="hd*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK+="%c{1} %c{2}"
|
||
|
# scsi-devfs.sh returns 5, we care about 3 and 5
|
||
|
BUS=="scsi", KERNEL=="sd*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sd %b %n", NAME="%k", SYMLINK+="%c{3} %c{5}"
|
||
|
|
||
|
# persistent device links in /dev/disk
|
||
|
KERNEL=="hd*[!0-9]", IMPORT="/sbin/ata_id --export $tempnode"
|
||
|
KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="dist/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"
|
||
|
|
||
|
KERNEL=="sd*[!0-9]", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394'"
|
||
|
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/usb_id -x"
|
||
|
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -s %p -d %N"
|
||
|
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -a -s %p -d %N"
|
||
|
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
|
||
|
KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*"
|
||
|
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
|
||
|
|
||
|
# floppy devices
|
||
|
KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK="%k"
|
||
|
|
||
|
# loop devices
|
||
|
KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
|
||
|
|
||
|
# md devices
|
||
|
KERNEL=="md[0-9]*", NAME="md/%n", SYMLINK="%k"
|
||
|
|
||
|
|
||
|
# DRI devices (LSB spec)
|
||
|
KERNEL=="card*", NAME="dri/card%n", GROUP="video", MODE="0666"
|
||
|
|
||
|
# nvidia/3dfx video devices
|
||
|
KERNEL=="nvidia*", NAME="%k", GROUP="video"
|
||
|
KERNEL=="3dfx*", NAME="%k", GROUP="video"
|
||
|
|
||
|
|
||
|
# sound devices get assigned to the "audio" group
|
||
|
SUBSYSTEM=="sound", GROUP="audio"
|
||
|
|
||
|
# ALSA sound 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"
|
||
|
|
||
|
# OSS 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"
|
||
|
|
||
|
|
||
|
# input devices
|
||
|
KERNEL=="mice", NAME="input/%k", MODE="0644"
|
||
|
KERNEL=="mouse*", NAME="input/%k", MODE="0644"
|
||
|
KERNEL=="event*", NAME="input/%k", MODE="0600"
|
||
|
KERNEL=="js*", NAME="input/%k", MODE="0644"
|
||
|
KERNEL=="ts*", NAME="input/%k", MODE="0600"
|
||
|
|
||
|
|
||
|
# 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"
|
||
|
|
||
|
|
||
|
# CAPI devices
|
||
|
KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
|
||
|
KERNEL=="capi*", NAME="capi/%n"
|
||
|
|
||
|
|
||
|
# network devices
|
||
|
KERNEL=="tun", NAME="net/%k"
|
||
|
|
||
|
|
||
|
# raw devices
|
||
|
KERNEL=="raw[0-9]*", NAME="raw/%k"
|
||
|
|
||
|
|
||
|
# framebuffer devices
|
||
|
KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK="%k", GROUP="video"
|
||
|
|
||
|
|
||
|
# V4L devices
|
||
|
KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK="video%n", GROUP="video"
|
||
|
KERNEL=="radio[0-9]*", NAME="v4l/radeo%n", SYMLINK="radeo%n", GROUP="video"
|
||
|
KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK="vbi%n", GROUP="video"
|
||
|
KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", SYMLINK="vtx%n", GROUP="video"
|
||
|
|
||
|
# DVB devices
|
||
|
KERNEL=="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c", GROUP="video", MODE="0660"
|
||
|
|
||
|
|
||
|
# I2C devices
|
||
|
KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
|
||
|
|
||
|
|
||
|
# misc devices
|
||
|
KERNEL=="agpgart", NAME="misc/%k", SYMLINK="%k", MODE="0664"
|
||
|
KERNEL=="psaux", NAME="misc/%k", SYMLINK="%k", MODE="0664"
|
||
|
KERNEL=="rtc", NAME="misc/%k", SYMLINK="%k", MODE="0664"
|
||
|
KERNEL=="inotify", NAME="misc/%k", SYMLINK="%k", MODE="0664"
|
||
|
|
||
|
|
||
|
# tty devices
|
||
|
KERNEL=="console", NAME="%k", GROUP="tty", MODE="0600"
|
||
|
KERNEL=="tty", NAME="%k", GROUP="tty", MODE="0666"
|
||
|
KERNEL=="tty[0-9]*", NAME="vc/%n", SYMLINK="%k", GROUP="tty"
|
||
|
KERNEL=="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k", GROUP="tty"
|
||
|
KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", GROUP="tty", MODE="0600"
|
||
|
|
||
|
|
||
|
# mem devices
|
||
|
KERNEL=="random", NAME="%k", MODE="0666"
|
||
|
KERNEL=="urandom", NAME="%k", MODE="0444"
|
||
|
KERNEL=="mem", NAME="%k", MODE="0640"
|
||
|
KERNEL=="kmem", NAME="%k", MODE="0640"
|
||
|
KERNEL=="port", NAME="%k", MODE="0640"
|
||
|
KERNEL=="full", NAME="%k", MODE="0666"
|
||
|
KERNEL=="null", NAME="%k", MODE="0666"
|
||
|
KERNEL=="zero", NAME="%k", MODE="0666"
|
||
|
|
||
|
|
||
|
# pty devices
|
||
|
KERNEL=="ptmx", NAME="%k", GROUP="tty", MODE="0666"
|
||
|
KERNEL=="pty[p-za-f][0-9a-f]*", NAME="pty/m%n", SYMLINK="%k", GROUP="tty"
|
||
|
KERNEL=="tty[p-za-f][0-9a-f]*", NAME="pty/s%n", SYMLINK="%k", GROUP="tty"
|
||
|
|
||
|
|
||
|
# emulate dev.d and hotplug.d
|
||
|
ENV{UDEVD_EVENT}=="1", RUN+="/lib/udev/udev_run_hotplugd"
|
||
|
RUN+="/lib/udev/udev_run_devd"
|