summaryrefslogtreecommitdiff
path: root/etc/udev
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-12-31 20:35:02 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:14 -0700
commit6d88260a8be069a65ab52fa924e6d4dc13c4e83c (patch)
tree51fb7b1d6ce340adb74e733080fad3525543f303 /etc/udev
parent9f7fff04ee0b58f22936693649edb7bd1f5ea8bf (diff)
[PATCH] move the config files to etc/udev to clean up main directory a bit.
Diffstat (limited to 'etc/udev')
-rw-r--r--etc/udev/udev.conf.in23
-rw-r--r--etc/udev/udev.permissions7
-rw-r--r--etc/udev/udev.permissions.debian111
-rw-r--r--etc/udev/udev.rules49
-rw-r--r--etc/udev/udev.rules.devfs43
5 files changed, 233 insertions, 0 deletions
diff --git a/etc/udev/udev.conf.in b/etc/udev/udev.conf.in
new file mode 100644
index 0000000000..d06b0b0698
--- /dev/null
+++ b/etc/udev/udev.conf.in
@@ -0,0 +1,23 @@
+# udev.conf
+# The main config file for udev
+#
+# This file can be used to override some of udev's default values
+# for where it looks for files, and where it places device nodes.
+
+
+# udev_root - where in the filesystem to place the device nodes
+udev_root="@udevdir@/"
+
+# udev_db - The name and location of the udev database.
+udev_db="@udevdir@/.udev.tdb"
+
+# udev_rules - The name and location of the udev rules file
+udev_rules="/etc/udev/udev.rules"
+
+# udev_permissions - The name and location of the udev permission file
+udev_permissions="/etc/udev/udev.permissions"
+
+# default_mode - set the default mode for all nodes that have no
+# explicit match in the permissions file
+default_mode="0600"
+
diff --git a/etc/udev/udev.permissions b/etc/udev/udev.permissions
new file mode 100644
index 0000000000..e87b4ddc67
--- /dev/null
+++ b/etc/udev/udev.permissions
@@ -0,0 +1,7 @@
+#name:user:group:mode
+ttyUSB0:root:uucp:0660
+ttyUSB1:root:uucp:0666
+pl2303:500:500:0666
+visor:root:uucp:0666
+dsp1:::0666
+camera*:500:500:0666
diff --git a/etc/udev/udev.permissions.debian b/etc/udev/udev.permissions.debian
new file mode 100644
index 0000000000..5df3d0feac
--- /dev/null
+++ b/etc/udev/udev.permissions.debian
@@ -0,0 +1,111 @@
+# name:user:group:mode
+
+# CHARACTER DEVICES
+
+# tty devices
+tty:root:tty:0660
+console:root:tty:0600
+ptmx:root:tty:0666
+ttyACM*:root:dialout:0660
+ttyUSB*:root:dialout:0660
+ttyI*:root:dialout:0660
+ttyS*:root:dialout:0660
+ttySC*:root:dialout:0660
+ttyB*:root:dialout:0660
+ttyC*:root:dialout:0660
+ttyD*:root:dialout:0660
+ttyE*:root:dialout:0660
+ttyH*:root:dialout:0660
+ttyI*:root:dialout:0660
+ttyL*:root:dialout:0660
+ttyM*:root:dialout:0660
+ttyP*:root:dialout:0660
+ttyR*:root:dialout:0660
+ttyV*:root:dialout:0660
+ttyW*:root:dialout:0660
+ttyX*:root:dialout:0660
+tts/*:root:dialout:0660
+ippp*:root:dialout:0660
+isdn*:root:dialout:0660
+isdnctrl*:root:dialout:0660
+capi*:root:dialout:0660
+dcbri*:root:dialout:0660
+ircomm*:root:dialout:0660
+
+# Memory devices
+random:root:root:0666
+urandom:root:root:0444
+mem:root:kmem:0640
+kmem:root:kmem:0640
+port:root:kmem:0640
+full:root:root:0666
+null:root:root:0666
+zero:root:root:0666
+
+# Misc devices
+nvram:root:root:0660
+rtc:root:root:0660
+
+admmidi*:root:audio:660
+adsp*:root:audio:660
+aload*:root:audio:660
+amidi*:root:audio:660
+amixer*:root:audio:660
+audio*:root:audio:660
+dmfm*:root:audio:660
+dsp*:root:audio:660
+audio*:root:audio:660
+mixer*:root:audio:660
+music:root:audio:660
+sequencer*:root:audio:660
+snd/*:root:audio:660
+sound/*:root:audio:660
+
+lp*:root:lp:0660
+parport*:root:lp:0660
+irlpt*:root:lp:0660
+usblp*:root:lp:0660
+usb/lp*:root:lp:0660
+
+js:root:root:644
+djs:root:root:644
+input/*:root:root:644
+
+dri/card*:root:root:666
+
+fb*:root:video:0620
+agpgart:root:video:0660
+video*:root:video:0660
+radio*:root:video:0660
+vbi*:root:video:0660
+vtx*:root:video:0660
+mol:root:root:0600
+
+
+# BLOCK DEVICES
+
+floppy*:root:floppy:660
+floppy/*:root:floppy:660
+
+ram*:root:disk:660
+raw/*:root:disk:660
+
+hd*:root:disk:660
+sd*:root:disk:660
+dasd*:root:disk:660
+ataraid*:root:disk:660
+loop*:root:disk:660
+md*:root:disk:660
+
+sr*:root:cdrom:660
+scd*:root:cdrom:660
+sr*:root:cdrom:660
+
+ht*:root:tape:0660
+nht*:root:tape:0660
+pt*:root:tape:0660
+npt*:root:tape:0660
+st*:root:tape:0660
+nst*:root:tape:0660
+
+dm-*:root:root:0640
diff --git a/etc/udev/udev.rules b/etc/udev/udev.rules
new file mode 100644
index 0000000000..06d5842c2a
--- /dev/null
+++ b/etc/udev/udev.rules
@@ -0,0 +1,49 @@
+# There are a number of modifiers that are allowed to be used in the NAME or PROGRAM 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 return value for the CALLOUT program (note, this doesn't work within
+# the PROGRAM field for the obvious reason.)
+# %D - use the devfs style disk name for this device.
+# For partitions, this will result in 'part%n'
+# If this is not a partition, it will result in 'disc'
+#
+
+# Looking for scsi bus id 42:0:0:1
+CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n test-%b", ID="test-42:0:0:1", NAME="%c"
+
+# A usb camera.
+LABEL, BUS="usb", SYSFS_vendor="FUJIFILM", SYSFS_model="M100", NAME="camera%n"
+
+# USB Epson printer to be called lp_epson
+LABEL, BUS="usb", SYSFS_serial="HXOLL0012202323480", NAME="lp_epson"
+
+# USB HP printer to be called lp_hp
+LABEL, BUS="usb", SYSFS_serial="W09090207101241330", NAME="lp_hp"
+
+# sound card with PCI bus id 00:0b.0 to be the first sound card
+NUMBER, BUS="pci", ID="00:0b.0", NAME="dsp"
+
+# sound card with PCI bus id 00:07.1 to be the second sound card
+NUMBER, BUS="pci", ID="00:07.1", NAME="dsp1"
+
+# USB mouse plugged into the third port of the first hub to be called mouse0
+TOPOLOGY, BUS="usb", PLACE="1.3", NAME="mouse0"
+
+# USB tablet plugged into the third port of the second hub to be called mouse1
+TOPOLOGY, BUS="usb", PLACE="2.3", NAME="mouse1"
+TOPOLOGY, BUS="usb", PLACE="2.4", NAME="mouse2"
+
+# ttyUSB1 should always be called visor
+REPLACE, KERNEL="ttyUSB1", NAME="visor"
+REPLACE, KERNEL="ttyUSB0", NAME="pl2303"
+
+# a devfs like way to name some tty devices
+#REPLACE, KERNEL="ttyS*", NAME="tts/%n"
+#REPLACE, KERNEL="tty*", NAME="vc/%n"
+
+
diff --git a/etc/udev/udev.rules.devfs b/etc/udev/udev.rules.devfs
new file mode 100644
index 0000000000..0d579a4dd4
--- /dev/null
+++ b/etc/udev/udev.rules.devfs
@@ -0,0 +1,43 @@
+# These rules are to try to emulate a devfs naming scheme in udev
+# if there are any missing rules, please let the udev developers
+# know.
+#
+# There are a number of modifiers that are allowed to be used in the
+# a number 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'
+# %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 return value for the CALLOUT program (note, this doesn't work within
+# the PROGRAM field for the obvious reason.)
+# %D - use the devfs style disk name for this device.
+# For partitions, this will result in 'part%n'
+# If this is not a partition, it will result in 'disc'
+#
+
+# ide block devices
+NUMBER, BUS="ide", id="0.0", NAME="ide/host0/bus0/target0/lun0/%D"
+NUMBER, BUS="ide", id="0.1", NAME="ide/host0/bus0/target1/lun0/%D"
+NUMBER, BUS="ide", id="1.0", NAME="ide/host0/bus1/target0/lun0/%D"
+NUMBER, BUS="ide", id="1.1", NAME="ide/host0/bus1/target1/lun0/%D"
+
+# md block devices
+REPLACE, KERNEL="md[0-9]*", NAME="md/%n"
+
+# tty devices
+REPLACE, KERNEL="tty[0-9]*", NAME="vc/%n"
+REPLACE, KERNEL="ttyS[0-9]*", NAME="tts/%n"
+REPLACE, KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
+
+# vc devices
+REPLACE, KERNEL="vcs", NAME="vcc/0"
+REPLACE, KERNEL="vcs[0-9]*", NAME="vcc/%n"
+REPLACE, KERNEL="vcsa", NAME="vcc/a0"
+REPLACE, KERNEL="vcsa[0-9]*", NAME="vcc/a%n"
+
+# v4l devices
+REPLACE, KERNEL="video[0-9]*", NAME="v4l/video%n"
+REPLACE, KERNEL="radio[0-9]*", NAME="v4l/radio%n"
+REPLACE, KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
+REPLACE, KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"