summaryrefslogtreecommitdiff
path: root/rules/gentoo/30-kernel-compat.rules
blob: d6d44137266be054c08d611254523e5d38f89a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# do not edit this file, it will be overwritten on update

ACTION!="add|change", GOTO="kernel_compat_end"

#
# naming device rules
#

# dvb device naming
# needed for kernels <2.6.29-rc1
SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"

# naming rules for kernels <2.6.31

# alsa names
KERNEL=="controlC[0-9]*",	NAME="snd/%k"
KERNEL=="hwC[D0-9]*",		NAME="snd/%k"
KERNEL=="pcmC[D0-9cp]*",	NAME="snd/%k"
KERNEL=="midiC[D0-9]*",		NAME="snd/%k"
KERNEL=="timer",		NAME="snd/%k"
KERNEL=="seq",			NAME="snd/%k"

KERNEL=="mwave",		NAME="modems/mwave"

KERNEL=="mouse*|mice|event*",	NAME="input/%k"
KERNEL=="ts[0-9]*|uinput",	NAME="input/%k"
KERNEL=="js[0-9]*",		NAME="input/%k"

KERNEL=="card[0-9]*",		NAME="dri/%k"

SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}"

# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"

# printer
SUBSYSTEM=="usb",		KERNEL=="lp*", NAME="usb/%k"

# block
KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k"
KERNEL=="pktcdvd", NAME="pktcdvd/control"

KERNEL=="rawctl", NAME="raw/rawctl"
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k"
SUBSYSTEM=="bsg", NAME="bsg/%k"
SUBSYSTEM=="aoe", NAME="etherd/%k"

# network
KERNEL=="tun",			NAME="net/%k"

# CPU
KERNEL=="cpu[0-9]*",		NAME="cpu/%n/cpuid"
KERNEL=="msr[0-9]*",		NAME="cpu/%n/msr"
KERNEL=="microcode",		NAME="cpu/microcode", MODE="0600"

# miscellaneous
KERNEL=="auer[0-9]*",		NAME="usb/%k"
KERNEL=="hw_random",		NAME="hwrng"
KERNEL=="sxctl",		NAME="specialix_sxctl"
KERNEL=="rioctl",		NAME="specialix_rioctl"
KERNEL=="iowarrior[0-9]*",	NAME="usb/%k"
KERNEL=="hiddev[0-9]*",		NAME="usb/%k"
KERNEL=="legousbtower[0-9]*",	NAME="usb/%k"
KERNEL=="dabusb[0-9]*",		NAME="usb/%k"
KERNEL=="usbdpfp[0-9]*",	NAME="usb/%k"
KERNEL=="cpad[0-9]*",		NAME="usb/%k"

# end of naming rules for kernel <2.6.31


#
# module loading rules
#
ACTION!="add", GOTO="kernel_compat_end"

# No need for more code, as MODALIAS is present
ENV{MODALIAS}=="?*", GOTO="kernel_compat_end"

# needed for kernel <2.6.30-rc1
SUBSYSTEM=="scsi", ATTR{type}=="8", RUN+="/sbin/modprobe -b ch"
SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -b mmc_block"

# needed for kernel <2.6.27-rc5
# acpi will do on newer kernels
SUBSYSTEM=="pnp", DRIVER!="?*", \
  RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"

LABEL="kernel_compat_end"