chiark / gitweb /
vol_id: fix language in manpage
[elogind.git] / rules / gentoo / 30-kernel-compat.rules
1 # do not edit this file, it will be overwritten on update
2
3 ACTION!="add|change", GOTO="kernel_compat_end"
4
5 #
6 # rules to workaround bad sysfs timing
7 #
8
9 ACTION!="add", GOTO="kernel_compat_wait_end"
10
11 # workarounds needed to synchronize with sysfs
12 # needed for kernels < v2.6.18-rc1
13 DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
14 SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*",    WAIT_FOR_SYSFS="ioerr_cnt"
15
16 # needed for kernels <2.6.16
17 SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
18
19 # needed for kernels <2.6.17
20 SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
21
22 LABEL="kernel_compat_wait_end"
23
24 #
25 # naming device rules
26 #
27
28 # old style usb sysfs devices
29 # needed for kernels <2.6.22
30 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"
31
32 # /sys/class/block will export this
33 # needed for kernels <2.6.25-rc1
34 SUBSYSTEM!="block", GOTO="block_devtype_end"
35 ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk"
36 ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition"
37 LABEL="block_devtype_end"
38
39
40 #
41 # module loading rules
42 #
43 ACTION!="add", GOTO="kernel_compat_end"
44
45 # this driver is broken and should not be loaded automatically
46 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962
47 # needed for kernels <2.6.21
48 SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", ENV{MODALIAS}=""
49
50 # No need for more code, as MODALIAS is present
51 ENV{MODALIAS}=="?*", GOTO="kernel_compat_end"
52
53 # needed for kernel <2.6.27-rc5
54 # acpi will do on newer kernels
55 SUBSYSTEM=="pnp", DRIVER!="?*", \
56   RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
57
58 # needed for kernels <2.6.22
59 SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end"
60
61         # Parts taken from redhat-rules
62         # sd:           0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
63         # sr:           4 TYPE_WORM, 5 TYPE_ROM
64         # st/osst:      1 TYPE_TAPE
65
66         ATTRS{type}=="0|7|14",  RUN+="/sbin/modprobe sd_mod"
67         ATTRS{type}=="4|5",     RUN+="/sbin/modprobe sr_mod"
68         ATTRS{type}=="8",       RUN+="/sbin/modprobe ch"
69
70         ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \
71                 ATTRS{model}!="ADR*", RUN+="/sbin/modprobe osst", GOTO="kernel_compat_end"
72         ATTRS{type}=="1", RUN+="/sbin/modprobe st"
73
74 LABEL="kernel_compat_end"
75