Project

General

Profile

Bug #273 » mdev.conf

Initial merged PiBox and nldev mdev.conf - Hammel, 19 Feb 2014 19:23

 
1
# Provide user, group, and mode information for devices.  If a regex matches
2
# the device name provided by sysfs, use the appropriate user:group and mode
3
# instead of the default 0:0 660.
4
#
5
# Syntax:
6
# [-]devicename_regex user:group mode [>|=path] [@|$|*cmd args...]
7
# [-]$varname=regex user:group mode [>|=path] [@|$|*cmd args...]
8
# [-]subsystem/regex user:group mode [>|=path] [@|$|*cmd args...]
9
# [-]@major,minor[-minor2] user:group mode [>|=path] [@|$|*cmd args...]
10
#
11
# Leading minus in 1st field means "don't stop on this line", otherwise
12
# search is stopped after the first match.
13
# default is 0:0 660. user, group can be names (no nss!) or numeric.
14
#
15
# =: move, >: move and create a symlink from match to new name
16
# if lhs is regex: %1..%9 are backrefs to captures
17
# !: don't create node (but run scripts)
18
# @|$|*: run $cmd on delete, @cmd on create, *cmd on both AND on change
19
# cmd also gets $SUBSYSTEM and $MDEV
20

    
21
# If it's there, this will help debug mdev issues.
22
# -.* root:root 666 @/usr/bin/mdevdebug.sh
23

    
24
$MODALIAS=.*    root:root 660   @/bin/busybox modprobe "$MODALIAS"
25

    
26
# null may already exist; therefore ownership has to be changed with command
27
null            root:root 666 @chmod 666 $MDEV
28
zero            root:root 666
29
full            root:root 666
30
random          root:root 666
31
urandom         root:root 666
32
hwrandom        root:root 444
33
hw_random       root:root 444   =hwrng
34
grsec           root:root 660
35
kmem            root:root 640
36
mem             root:root 640
37
port            root:root 640
38

    
39
# Block devices and removable media
40
sd[a-z][0-9]        root:nobody 660 */usr/bin/blockhandler.sh
41
mmcblk[0-9]p[0-9]   root:nobody 660 */usr/bin/blockhandler.sh
42
ram[0-9]*           root:nobody 660
43
loop[0-9]*          root:nobody 660
44
sd[!a-z].*          root:nobody 660 */lib/mdev/sddev
45
hd[!a-z].*          root:nobody 660 */lib/mdev/hddev
46
control             root:root 000   =mapper/
47
md.*                root:nobody 660
48
mtd.*               root:nobody 660
49
ndb.*               root:nobody 660
50
gnbd.*              root:nobody 660
51
btibm.*             root:nobody 660
52
dm-.*               root:nobody 660
53
vd.*                root:nobody 660
54
sg.*                root:nobody 660
55

    
56
# block-related
57
scsi.*/.*       root:nobody 660 !
58
bdi.*/.*        root:nobody 660 !
59

    
60
sch[0-9]*       root:nobody 660
61
pg[0-9]*        root:nobody 660
62

    
63
qft[0-9]*       root:nobody 660
64
nqft[0-9]*      root:nobody 660
65
zqft[0-9]*      root:nobody 660
66
nzqft[0-9]*     root:nobody 660
67
rawqft[0-9]*    root:nobody 660
68
nrawqft[0-9]*   root:nobody 660
69

    
70
rawctl          root:nobody 660 =raw/
71
raw[0-9]*       root:nobody 660 =raw/
72
aoe.*           root:nobody 660 =etherd/
73
bsg/.*          root:nobody 660 =bsg/
74

    
75
# Typical devices
76
# console may already exist; therefore ownership has to be changed with command
77
console         root:root 600 @chmod 600 $MDEV
78
ptmx            root:root 666
79
pty.*           root:root 660
80
tty             root:root 666
81
tty[0-9]*       root:root 660
82
vcsa*[0-9]*     root:root 660
83

    
84
# serial
85
ttyS[0-9]*      root:root 660
86
ppox[0-9]*      root:root 660
87
ircomm[0-9]*    root:root 660
88
noz[0-9]*       root:root 660
89
rfcomm[0-9]*    root:root 660
90
mwave           root:root 660
91
hvc.*           root:root 660
92
hvsi.*          root:root 660
93
ttyUSB[0-9]*    root:root 660
94
ttyACM[0-9]*    root:root 660
95
ttyLTM[0-9]*    root:root 660
96
ttySHSF[0-9]*   root:root 660
97
slamr           root:root 660
98
slusb           root:root 660
99

    
100
# alsa sound devices
101
pcm.*           root:root 660 =snd/
102
control.*       root:root 660 =snd/
103
midi.*          root:root 660 =snd/
104
seq             root:root 660 =snd/
105
timer           root:root 660 =snd/
106

    
107
# input stuff
108
input/event[0-9]*   root:root 640   */lib/mdev/inputdev
109
input/js[0-9]*      root:root 644
110
input/.*            root:root 640
111
# mice          root:root 640 =input/
112
# mouse[0-9]    root:root 640 =input/
113
# ts[0-9]       root:root 600 =input/
114

    
115
# v4l
116
vttuner.*       root:root 660  >v4l/
117
video.*         root:root 660  >v4l/
118
vtx.*           root:root 660  >v4l/
119
vbi.*           root:root 660  >v4l/ 
120
winradio.*      root:root 660  >v4l/
121
v4l.*           root:root 660  >v4l/
122

    
123
# USB connected devices
124
# usb.*           root:root -   @/usr/bin/usbhandler.sh
125
bus/usb/.*      root:root 665    */lib/mdev/usb
126

    
127
# graphics
128
fb[0-9]*        root:root 660
129

    
130
# dri
131
card[0-9]*  root:video 660  =dri/
132
controlD[0-9]*  root:root 660  =dri/
133

    
134
# dvb
135
dvb.*           root:root 660  */lib/mdev/dvbdev
136

    
137
# audio
138
snd/.*          root:root 660
139
hpet            root:root 660
140
adsp            root:root 660
141
audio           root:root 660
142
dsp             root:root 660
143
mixer           root:root 660
144
sequencer.*     root:root 660
145

    
146
# network
147
-net/.*         root:root 600   @nameif
148
tun             root:root 666   =net/
149
tun[0-9]*       root:root 600   =net/
150
tap[0-9]*       root:root 600   =net/
151
rfkill          root:rfkill 64
152

    
153
# misc
154
rtc             root:root 664
155
rtc[0-9]*       root:root 664   @ln -sf $MDEV rtc
156
hiddev[0-9]*    root:root 660   =usb/
157

    
(3-3/4)