1 |
# /etc/udev/rules/30-kernel-compat.rules: kernel compat rules for udev |
# /etc/udev/rules/30-kernel-compat.rules: kernel compat rules for udev |
2 |
# $Header: /root/magellan-cvs/src/udev/udev-kernel-compat.rules.magellan,v 1.1 2008-03-22 18:13:36 niro Exp $ |
# $Header: /root/magellan-cvs/src/udev/udev-kernel-compat.rules.magellan,v 1.2 2008-12-22 20:31:37 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: |
18 |
# file that can be run before this one. |
# file that can be run before this one. |
19 |
# |
# |
20 |
|
|
21 |
ACTION!="add", GOTO="kernel_compat_end" |
ACTION!="add|change", GOTO="kernel_compat_end" |
22 |
|
|
23 |
|
# |
24 |
|
# rules to workaround bad sysfs timing |
25 |
|
# |
26 |
|
|
27 |
|
ACTION!="add", GOTO="kernel_compat_wait_end" |
28 |
|
|
29 |
# workarounds needed to synchronize with sysfs |
# workarounds needed to synchronize with sysfs |
30 |
|
# needed for kernels < v2.6.18-rc1 |
31 |
DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" |
DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" |
32 |
|
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt" |
33 |
|
|
34 |
# needed for kernels <2.6.16 |
# needed for kernels <2.6.16 |
35 |
SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" |
SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" |
37 |
# needed for kernels <2.6.17 |
# needed for kernels <2.6.17 |
38 |
SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" |
SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" |
39 |
|
|
40 |
|
LABEL="kernel_compat_wait_end" |
41 |
|
|
42 |
|
# |
43 |
|
# naming device rules |
44 |
|
# |
45 |
|
|
46 |
|
# old style usb sysfs devices |
47 |
# needed for kernels <2.6.22 |
# needed for kernels <2.6.22 |
48 |
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" |
49 |
|
|
50 |
|
# /sys/class/block will export this |
51 |
|
# needed for kernels <2.6.25-rc1 |
52 |
|
SUBSYSTEM!="block", GOTO="block_devtype_end" |
53 |
|
ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk" |
54 |
|
ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition" |
55 |
|
LABEL="block_devtype_end" |
56 |
|
|
57 |
|
|
58 |
|
# |
59 |
|
# module loading rules |
60 |
|
# |
61 |
|
ACTION!="add", GOTO="kernel_compat_end" |
62 |
|
|
63 |
# this driver is broken and should not be loaded automatically |
# this driver is broken and should not be loaded automatically |
64 |
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962 |
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962 |
65 |
# needed for kernels <2.6.21 |
# needed for kernels <2.6.21 |
68 |
# No need for more code, as MODALIAS is present |
# No need for more code, as MODALIAS is present |
69 |
ENV{MODALIAS}=="?*", GOTO="kernel_compat_end" |
ENV{MODALIAS}=="?*", GOTO="kernel_compat_end" |
70 |
|
|
71 |
|
# needed for kernel <2.6.27-rc5 |
72 |
|
# acpi will do on newer kernels |
73 |
|
SUBSYSTEM=="pnp", DRIVER!="?*", \ |
74 |
|
RUN{ignore_error}+="/bin/sh -c 'modprobe.sh -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'" |
75 |
|
|
76 |
# needed for kernels <2.6.22 |
# needed for kernels <2.6.22 |
77 |
SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end" |
SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end" |
78 |
|
|
81 |
# sr: 4 TYPE_WORM, 5 TYPE_ROM |
# sr: 4 TYPE_WORM, 5 TYPE_ROM |
82 |
# st/osst: 1 TYPE_TAPE |
# st/osst: 1 TYPE_TAPE |
83 |
|
|
84 |
ATTRS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod" |
ATTRS{type}=="0|7|14", RUN+="modprobe.sh sd_mod" |
85 |
ATTRS{type}=="4|5", RUN+="/sbin/modprobe sr_mod" |
ATTRS{type}=="4|5", RUN+="modprobe.sh sr_mod" |
86 |
ATTRS{type}=="8", RUN+="/sbin/modprobe ch" |
ATTRS{type}=="8", RUN+="modprobe.sh ch" |
87 |
|
|
88 |
ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \ |
ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \ |
89 |
ATTRS{model}!="ADR*", RUN+="/sbin/modprobe osst", GOTO="kernel_compat_end" |
ATTRS{model}!="ADR*", RUN+="modprobe.sh osst", GOTO="kernel_compat_end" |
90 |
ATTRS{type}=="1", RUN+="/sbin/modprobe st" |
ATTRS{type}=="1", RUN+="modprobe.sh st" |
91 |
|
|
92 |
LABEL="kernel_compat_end" |
LABEL="kernel_compat_end" |