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.3 2007-06-10 21:25:29 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: |
44 |
# cdrom symlinks and other good cdrom naming |
# cdrom symlinks and other good cdrom naming |
45 |
KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", ACTION=="add", IMPORT{program}="cdrom_id --export $tempnode" |
KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", ACTION=="add", IMPORT{program}="cdrom_id --export $tempnode" |
46 |
ENV{ID_CDROM}=="?*", GROUP="cdrom" |
ENV{ID_CDROM}=="?*", GROUP="cdrom" |
47 |
|
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" |
48 |
|
|
49 |
# assign cdrom-permission also to associated generic device (for cd-burning ...) |
# assign cdrom-permission also to associated generic device (for cd-burning ...) |
50 |
KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom" |
KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom" |
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" |
247 |
|
|
248 |
|
|
249 |
# usbfs-like device nodes |
# usbfs-like device nodes |
250 |
|
# 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" |
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 |
|
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 |
# Setting timeout for tape-devices (type 1) to 900 seconds |
257 |
# and 60 seconds for device types 0, 7 and 14 |
# 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 |
260 |
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60" |
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" |
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900" |
262 |
|
|
|
# Module autoloading |
|
|
ACTION!="add", GOTO="hotplug_no_add_event" |
|
|
|
|
|
# check if the device has already been claimed by a driver |
|
|
ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_load_end" |
|
|
|
|
|
# this driver is broken and should not be loaded automatically |
|
|
SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="hotplug_load_end" |
|
|
|
|
|
# Autoload modules that lack aliases but have them defined inutoload modules |
|
|
ENV{MODALIAS}=="?*", RUN+="modprobe.sh $env{MODALIAS}" |
|
|
|
|
|
# /etc/modprobe.conf. |
|
|
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN+="/bin/sh -c 'while read id; do /lib/udev/modprobe.sh pnp:d$$id; done < /sys$devpath/id'" |
|
|
# needed aliases are defined in /etc/modprobe.d/pnp-aliases |
|
|
|
|
|
|
|
|
SUBSYSTEM=="i2o", RUN+="modprobe.sh i2o_block" |
|
|
SUBSYSTEM=="mmc", 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 |
|
|
SUBSYSTEM!="scsi_device", GOTO="hotplug_scsi_end" |
|
|
ATTRS{type}=="?*", RUN+="modprobe.sh sg" |
|
|
ATTRS{type}=="0|7|14", RUN+="modprobe.sh sd_mod" |
|
|
ATTRS{type}=="4|5", RUN+="modprobe.sh sr_mod" |
|
|
ATTRS{type}=="8", RUN+="modprobe.sh ch" |
|
|
|
|
|
ATTRS{type}=="1", ENV{ID_SCSI_TAPE_DRIVER}="st" |
|
|
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}" |
|
|
LABEL="hotplug_scsi_end" |
|
|
|
|
|
SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="modprobe.sh ide-scsi" |
|
|
|
|
|
LABEL="hotplug_load_end" |
|
|
|
|
263 |
# Load firmware |
# Load firmware |
264 |
SUBSYSTEM=="firmware", RUN+="firmware.sh" |
SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" |
|
|
|
|
LABEL="hotplug_no_add_event" |
|