7e0f129d356515c15fd43cd0c540d5cdc6ecf259
[openwrt/staging/chunkeey.git] / package / system / procd / files / hotplug.json
1 [
2 [ "case", "ACTION", {
3 "add": [
4 [ "if",
5 [ "and",
6 [ "has", "MAJOR" ],
7 [ "has", "MINOR" ]
8 ],
9 [
10 [ "if",
11 [ "eq", "DEVNAME",
12 [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ]
13 ],
14 [
15 [ "makedev", "/dev/%DEVNAME%", "0666" ],
16 [ "return" ]
17 ]
18 ],
19 [ "if",
20 [ "regex", "DEVNAME", "^snd" ],
21 [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
22 ],
23 [ "if",
24 [ "regex", "DEVNAME", "^tty" ],
25 [ "makedev", "/dev/%DEVNAME%", "0660", "dialout" ]
26 ],
27 [ "if",
28 [ "has", "DEVNAME" ],
29 [ "makedev", "/dev/%DEVNAME%", "0600" ]
30 ]
31 ]
32 ],
33 [ "if",
34 [ "has", "FIRMWARE" ],
35 [
36 [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
37 [ "load-firmware", "/lib/firmware" ],
38 [ "return" ]
39 ]
40 ],
41 [ "if",
42 [ "regex", "DEVNAME", "^ttyGS" ],
43 [ "start-console", "%DEVNAME%" ]
44 ]
45 ],
46 "remove" : [
47 [ "if",
48 [ "and",
49 [ "has", "DEVNAME" ],
50 [ "has", "MAJOR" ],
51 [ "has", "MINOR" ]
52 ],
53 [ "rm", "/dev/%DEVNAME%" ]
54 ]
55 ]
56 } ],
57 [ "if",
58 [ "and",
59 [ "has", "BUTTON" ],
60 [ "eq", "SUBSYSTEM", "button" ]
61 ],
62 [ "button", "/etc/rc.button/%BUTTON%" ]
63 ],
64 [ "if",
65 [ "and",
66 [ "eq", "SUBSYSTEM", "usb-serial" ],
67 [ "regex", "DEVNAME",
68 [ "^ttyUSB", "^ttyACM" ]
69 ]
70 ],
71 [ "exec", "/sbin/hotplug-call", "tty" ],
72 [ "if",
73 [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
74 [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
75 ]
76 ]
77 ]