1 |
# /etc/udev/rules/50-udev.rules: device naming rules for udev |
# /etc/udev/rules/50-udev.rules: device naming rules for udev |
2 |
# $Header: /root/magellan-cvs/src/udev/udev.rules.magellan,v 1.1 2007-03-21 16:48:37 niro Exp $ |
# $Header: /root/magellan-cvs/src/udev/udev.rules.magellan,v 1.4 2007-08-17 20:08:25 niro Exp $ |
3 |
# |
# |
4 |
# There are a number of modifiers that are allowed to be used in some |
# There are a number of modifiers that are allowed to be used in some |
5 |
# of the different fields. They provide the following subsitutions: |
# of the different fields. They provide the following subsitutions: |
42 |
SUBSYSTEM=="block", GROUP="disk" |
SUBSYSTEM=="block", GROUP="disk" |
43 |
|
|
44 |
# cdrom symlinks and other good cdrom naming |
# cdrom symlinks and other good cdrom naming |
45 |
BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode" |
KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", ACTION=="add", IMPORT{program}="cdrom_id --export $tempnode" |
46 |
BUS=="scsi", KERNEL=="sr[0-9]*", ACTION=="add", IMPORT="cdrom_id --export $tempnode" |
ENV{ID_CDROM}=="?*", GROUP="cdrom" |
47 |
BUS=="scsi", KERNEL=="scd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode" |
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" |
|
BUS=="scsi", KERNEL=="sg[0-9]*", ACTION=="add", DRIVERS=="sr", GROUP="cdrom" |
|
|
ENV{ID_CDROM}=="?*", PROGRAM="seq_node.sh %r %k cdrom", SYMLINK+="%c", GROUP="cdrom" |
|
|
ENV{ID_CDROM_CD_RW}=="?*", PROGRAM="seq_node.sh %r %k cdrw", SYMLINK+="%c" |
|
|
ENV{ID_CDROM_DVD}=="?*", PROGRAM="seq_node.sh %r %k dvd", SYMLINK+="%c" |
|
|
ENV{ID_CDROM_DVD_R}=="?*", PROGRAM="seq_node.sh %r %k dvdrw", SYMLINK+="%c" |
|
48 |
|
|
49 |
|
# assign cdrom-permission also to associated generic device (for cd-burning ...) |
50 |
|
KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom" |
51 |
|
|
52 |
# disk devices |
# disk devices |
53 |
KERNEL=="sd*", NAME="%k", GROUP="disk" |
KERNEL=="sd*", NAME="%k", GROUP="disk" |
84 |
KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" |
KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" |
85 |
KERNEL=="microcode", NAME="cpu/microcode" |
KERNEL=="microcode", NAME="cpu/microcode" |
86 |
|
|
|
# dm devices (ignore them) |
|
|
KERNEL=="dm-[0-9]*", OPTIONS="ignore_device" |
|
|
# create a symlink named after the device map name |
|
|
# note devmap_name comes with extras/multipath |
|
|
#KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c" |
|
|
KERNEL=="device-mapper", NAME="mapper/control" |
|
|
|
|
87 |
# fb devices |
# fb devices |
88 |
KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video" |
KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video" |
89 |
|
|
90 |
# floppy devices |
# floppy devices |
91 |
KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK+="%k", GROUP="floppy" |
KERNEL=="fd[0-9]*", NAME="floppy/%k", SYMLINK+="%k", GROUP="floppy" |
92 |
|
KERNEL=="fd[0-9]*", ACTION=="add", ATTRS{cmos}=="*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/floppy/%k" |
93 |
|
KERNEL=="fd[0-9]*", ACTION=="remove", RUN+="/bin/sh -c 'rm -f $root/floppy/%k?*'" |
94 |
|
|
95 |
# i2c devices |
# i2c devices |
96 |
KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k" |
KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k" |
99 |
KERNEL=="mice", NAME="input/%k", MODE="0644" |
KERNEL=="mice", NAME="input/%k", MODE="0644" |
100 |
KERNEL=="mouse*", NAME="input/%k", MODE="0644" |
KERNEL=="mouse*", NAME="input/%k", MODE="0644" |
101 |
KERNEL=="event*", NAME="input/%k", MODE="0600" |
KERNEL=="event*", NAME="input/%k", MODE="0600" |
102 |
KERNEL=="js*", NAME="input/%k", MODE="664" |
KERNEL=="js*", NAME="input/%k", MODE="0664" |
103 |
KERNEL=="ts*", NAME="input/%k", MODE="0600" |
KERNEL=="ts*", NAME="input/%k", MODE="0600" |
104 |
|
|
105 |
# loop devices |
# loop devices |
135 |
KERNEL=="tap*", NAME="netlink/%k" |
KERNEL=="tap*", NAME="netlink/%k" |
136 |
|
|
137 |
# network devices |
# network devices |
138 |
KERNEL=="tun", NAME="net/%k", MODE="0600" |
KERNEL=="tun", NAME="net/%k", MODE="0660", OPTIONS+="ignore_remove" |
139 |
|
KERNEL=="ppp", MODE="0600", OPTIONS+="ignore_remove" |
140 |
|
|
141 |
# ramdisk devices |
# ramdisk devices |
142 |
KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k" |
KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k" |
147 |
KERNEL=="video1394*", NAME="video1394/%n", GROUP="video" |
KERNEL=="video1394*", NAME="video1394/%n", GROUP="video" |
148 |
|
|
149 |
# raw devices |
# raw devices |
150 |
KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk" |
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk" |
151 |
KERNEL=="ram*", NAME="%k", GROUP="disk" |
KERNEL=="ram*", NAME="%k", GROUP="disk" |
152 |
|
|
153 |
# sound devices |
# sound devices |
177 |
KERNEL=="auer*", NAME="usb/%k" |
KERNEL=="auer*", NAME="usb/%k" |
178 |
KERNEL=="legousbtower*", NAME="usb/%k", GROUP="usb" |
KERNEL=="legousbtower*", NAME="usb/%k", GROUP="usb" |
179 |
KERNEL=="dabusb*", NAME="usb/%k" |
KERNEL=="dabusb*", NAME="usb/%k" |
180 |
BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp" |
KERNEL=="lp[0-9]*", SUBSYSTEM=="usb", NAME="usb/%k", GROUP="lp" |
181 |
|
|
182 |
# v4l devices |
# v4l devices |
183 |
KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video" |
KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video" |
247 |
|
|
248 |
|
|
249 |
# usbfs-like device nodes |
# usbfs-like device nodes |
250 |
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644" |
# the way to go up to kernel 2.6.21 (and above if setting USB_DEVICE_CLASS=y) |
251 |
|
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664" |
252 |
|
# starting from kernel 2.6.22 use this rule |
253 |
# Setting timeout for tape-devices to 900 seconds |
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", GROUP="usb", MODE="0664" |
254 |
|
|
255 |
|
# Timeouts for scsi devices |
256 |
|
# Setting timeout for tape-devices (type 1) to 900 seconds |
257 |
|
# and 60 seconds for device types 0, 7 and 14 |
258 |
# if you need timeouts for other devices add a similar rule |
# if you need timeouts for other devices add a similar rule |
259 |
# with correct type-value, or open a bug on bugs.gentoo.org. |
# with correct type-value, or open a bug on bugs.gentoo.org. |
260 |
ACTION=="add", SUBSYSTEM=="scsi" , ATTRS{type}=="1", RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'" |
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60" |
261 |
|
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900" |
|
# assign cdrom-permission also to associated generic device (for cd-burning ...) |
|
|
KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom" |
|
|
|
|
|
|
|
|
# Module autoloading |
|
|
# this driver is broken and should not be loaded automatically |
|
|
SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="module_load_end" |
|
|
|
|
|
# Autoload modules that lack aliases but have them defined inutoload modules |
|
|
ENV{MODALIAS}=="?*", ACTION=="add", RUN+="modprobe.sh $env{MODALIAS}" |
|
|
|
|
|
# /etc/modprobe.conf. |
|
|
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN+="/bin/sh -c 'while read id; do modprobe.sh pnp:d$$id; done < /sys$devpath/id'" |
|
|
# If you have problems with some pnp modules being loaded, please enter the |
|
|
# following aliases into the modprobe configuration files. These are needed by |
|
|
# udev to autoload some modules |
|
|
# alias pnp:dPNP0510 irtty-sir |
|
|
# alias pnp:dPNP0511 irtty-sir |
|
|
# alias pnp:dPNP0700 floppy |
|
|
# alias pnp:dPNP0800 pcspkr |
|
|
# alias pnp:dPNP0b00 rtc |
|
|
# alias pnp:dPNP0303 atkbd |
|
|
# alias pnp:dPNP0f13 psmouse |
|
|
# alias pnp:dPNPb02f analog |
|
|
|
|
|
|
|
|
SUBSYSTEM=="i2o", ACTION=="add", RUN+="modprobe.sh i2o_block" |
|
|
SUBSYSTEM=="mmc", ACTION=="add", RUN+="modprobe.sh mmc_block" |
|
|
|
|
|
# Parts taken from redhat-rules |
|
|
# sd: 0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC |
|
|
# sr: 4 TYPE_WORM, 5 TYPE_ROM |
|
|
# st/osst: 1 TYPE_TAPE |
|
|
|
|
|
# Load driver for scsi-device |
|
|
ACTION=="add", SUBSYSTEM=="scsi_device", RUN+="modprobe.sh sg" |
|
|
ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="0|7|14", RUN+="modprobe.sh sd_mod" |
|
|
ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="4|5", RUN+="modprobe.sh sr_mod" |
|
|
ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="8", RUN+="modprobe.sh ch" |
|
|
|
|
|
ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="1", ENV{ID_SCSI_TAPE_DRIVER}="st" |
|
|
ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", ATTRS{model}!="ADR*", ENV{ID_SCSI_TAPE_DRIVER}="osst" |
|
|
ENV{ID_SCSI_TAPE_DRIVER}=="?*", RUN+="modprobe.sh $env{ID_SCSI_TAPE_DRIVER}" |
|
|
|
|
|
SUBSYSTEM=="ide", ACTION=="add", ATTR{media}=="tape", RUN+="modprobe.sh ide-scsi" |
|
|
|
|
|
LABEL="module_load_end" |
|
262 |
|
|
263 |
# Load firmware |
# Load firmware |
264 |
SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" |
SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" |
|
|
|
|
# be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems |
|
|
# run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart |
|
|
#ENV{UDEVD_EVENT}=="1", RUN+="udev_run_hotplugd $env{SUBSYSTEM}" |
|
|
|
|
|
# always run /etc/dev.d/ stuff for now. |
|
|
RUN+="udev_run_devd $env{SUBSYSTEM}" |
|
|
|
|
|
# debugging monitor |
|
|
RUN+="socket:/org/kernel/udev/monitor" |
|