procd: make the preinit rules wildcard all buttons for failsafe
[openwrt.git] / package / 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                                                 [ "or",
12                                                         [ "eq", "DEVNAME",
13                                                                 [ "null", "full", "ptmx", "zero" ],
14                                                         ],
15                                                         [ "regex", "DEVNAME",
16                                                                 [ "^gpio", "^hvc", "^tty" ],
17                                                         ],
18                                                 ],
19                                                 [
20                                                         [ "makedev", "/dev/%DEVNAME%", "0666" ],
21                                                         [ "return" ],
22                                                 ]
23                                         ],
24                                         [ "if",
25                                                 [ "or",
26                                                         [ "eq", "DEVNAME", "mapper/control" ],
27                                                         [ "regex", "DEVPATH", "^ppp" ],
28                                                 ],
29                                                 [
30                                                         [ "makedev", "/dev/%DEVNAME%", "0600" ],
31                                                         [ "return" ],
32                                                 ],
33                                         ],
34                                         [ "if",
35                                                 [ "has", "DEVNAME" ],
36                                                 [
37                                                         [ "makedev", "/dev/%DEVNAME%", "0644" ],
38                                                         [ "return" ],
39                                                 ],
40                                         ],
41                                 ],
42                         ],
43                         [ "if",
44                                 [ "has", "FIRMWARE" ],
45                                 [
46                                         [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
47                                         [ "load-firmware", "/lib/firmware" ],
48                                         [ "return" ]
49                                 ]
50                         ],
51                 ],
52                 "remove" : [
53                         [ "if",
54                                 [ "and",
55                                         [ "has", "DEVNAME" ],
56                                         [ "has", "MAJOR" ],
57                                         [ "has", "MINOR" ],
58                                 ],
59                                 [ "rm", "/dev/%DEVNAME%" ]
60                         ]
61                 ]
62         } ],
63         [ "if",
64                 [ "eq", "SUBSYSTEM", "platform" ],
65                 [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
66         ],
67         [ "if",
68                 [ "and",
69                         [ "has", "BUTTON" ],
70                         [ "eq", "SUBSYSTEM", "button" ],
71                 ],
72                 [ "exec", "/etc/rc.button/%BUTTON%" ]
73         ],
74         [ "if",
75                 [ "eq", "SUBSYSTEM",
76                         [ "net", "input", "usb", "ieee1394", "block", "atm", "zaptel", "tty" ]
77                 ],
78                 [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
79         ],
80 ]