From 282988c4f8a85c28468e6442e86efe51dc71cc93 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 18 Jul 2008 15:56:03 +0200 Subject: move default rules from /etc/udev/rules.d/ to /lib/udev/rules.d/ None of these rules is supposed to be changed by users, so move them out of /etc. Custom rules, and automatically generated rules stay in /etc. All rules are still processed in lexical order, regardless which directory they live in. --- rules/gentoo/30-kernel-compat.rules | 47 +++++++++++++++++++++++++++++++++++++ rules/gentoo/40-gentoo.rules | 12 ++++++++++ rules/gentoo/40-video.rules | 24 +++++++++++++++++++ rules/gentoo/65-permissions.rules | 26 ++++++++++++++++++++ rules/gentoo/90-network.rules | 8 +++++++ 5 files changed, 117 insertions(+) create mode 100644 rules/gentoo/30-kernel-compat.rules create mode 100644 rules/gentoo/40-gentoo.rules create mode 100644 rules/gentoo/40-video.rules create mode 100644 rules/gentoo/65-permissions.rules create mode 100644 rules/gentoo/90-network.rules (limited to 'rules/gentoo') diff --git a/rules/gentoo/30-kernel-compat.rules b/rules/gentoo/30-kernel-compat.rules new file mode 100644 index 0000000000..1f767df8d8 --- /dev/null +++ b/rules/gentoo/30-kernel-compat.rules @@ -0,0 +1,47 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add", GOTO="kernel_compat_end" + +# workarounds needed to synchronize with sysfs +DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" + +# needed for kernels <2.6.16 +SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" + +# needed for kernels <2.6.17 +SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" + + + +# needed for kernels <2.6.22 +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" + + + +# this driver is broken and should not be loaded automatically +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962 +# needed for kernels <2.6.21 +SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", ENV{MODALIAS}="" + +# No need for more code, as MODALIAS is present +ENV{MODALIAS}=="?*", GOTO="kernel_compat_end" + +# needed for kernels <2.6.22 +SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end" + + # 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 + + ATTRS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod" + ATTRS{type}=="4|5", RUN+="/sbin/modprobe sr_mod" + ATTRS{type}=="8", RUN+="/sbin/modprobe ch" + + ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \ + ATTRS{model}!="ADR*", RUN+="/sbin/modprobe osst", GOTO="kernel_compat_end" + ATTRS{type}=="1", RUN+="/sbin/modprobe st" + +LABEL="kernel_compat_end" + + diff --git a/rules/gentoo/40-gentoo.rules b/rules/gentoo/40-gentoo.rules new file mode 100644 index 0000000000..99a1c66c69 --- /dev/null +++ b/rules/gentoo/40-gentoo.rules @@ -0,0 +1,12 @@ +# do not edit this file, it will be overwritten on update + +# capi devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi*", NAME="capi/%n" + +# old devfs path, removing this could break systems +# Bug 195839 +KERNEL=="md[0-9]*", SYMLINK+="md/%n" +KERNEL=="loop[0-9]*", SYMLINK+="loop/%n" +KERNEL=="ram[0-9]*", SYMLINK+="rd/%n" + diff --git a/rules/gentoo/40-video.rules b/rules/gentoo/40-video.rules new file mode 100644 index 0000000000..2d5e53411c --- /dev/null +++ b/rules/gentoo/40-video.rules @@ -0,0 +1,24 @@ +# do not edit this file, it will be overwritten on update + +# video4linux +KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="%k", GROUP="video" +KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="%k", GROUP="video" +KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="%k", GROUP="video" +KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="video" + +SUBSYSTEM=="dvb", GROUP="video" + +# device node will be /dev/dri/card? +KERNEL=="card*", GROUP="video" +KERNEL=="nvidia*", GROUP="video" +KERNEL=="3dfx*", GROUP="video" + +# svgalib +KERNEL=="svga*", GROUP="video" + +# Framebuffer +KERNEL=="fb[0-9]*", GROUP="video" + +# IEEE1394 (firewire) devices +KERNEL=="dv1394*|video1394*|raw1394*", GROUP="video" + diff --git a/rules/gentoo/65-permissions.rules b/rules/gentoo/65-permissions.rules new file mode 100644 index 0000000000..494f19e63f --- /dev/null +++ b/rules/gentoo/65-permissions.rules @@ -0,0 +1,26 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb", MODE="664" + +# cdrom devices +ENV{ID_CDROM}=="?*", GROUP="cdrom", MODE="660" +KERNEL=="pktcdvd|pktcdvd[0-9]*", GROUP="cdrom", MODE="660" +# assign cdrom-permission also to associated generic device (for cd-burning ...) +SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[45]", GROUP="cdrom", MODE="660" + + +# tape devices +KERNEL=="st[0-9]*|nst[0-9]*|ht[0-9]*|nht[0-9]*|pt[0-9]*|npt[0-9]*", \ + GROUP="tape", MODE="660" +SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[18]", GROUP="tape", MODE="660" + +# dialout devices +KERNEL=="ippp*|isdn*|dcbri*|capi*", GROUP="uucp" +KERNEL=="pilot", GROUP="uucp" + +# sound devices (sound=alsa, snd=oss) +SUBSYSTEM=="sound|snd", GROUP="audio" + +# Sony Vaio Jogdial sonypi device +KERNEL=="sonypi", MODE="0666" + diff --git a/rules/gentoo/90-network.rules b/rules/gentoo/90-network.rules new file mode 100644 index 0000000000..50903af157 --- /dev/null +++ b/rules/gentoo/90-network.rules @@ -0,0 +1,8 @@ +# do not edit this file, it will be overwritten on update + +# /etc/udev/rules/90-network.rules: triggering network init-scripts + +# Activate our network if we can +SUBSYSTEM=="net", ACTION=="add", RUN+="net.sh %k start" +SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop" + -- cgit v1.2.3-54-g00ecf