procd: fix file permissions of /dev/tty* nodes
[openwrt/openwrt.git] / package / system / procd / files / hotplug.json
index bcd169034b342d405a2802cca292524b11d04252..a1c9dc97fc0546384b524963b4f21ee80aa55d99 100644 (file)
                                        [ "if",
                                                [ "or",
                                                        [ "eq", "DEVNAME",
-                                                               [ "null", "full", "ptmx", "zero" ],
+                                                               [ "null", "full", "ptmx", "zero", "tty" ],
                                                        ],
                                                        [ "regex", "DEVNAME",
-                                                               [ "^gpio", "^hvc", "^tty" ],
+                                                               [ "^gpio", "^hvc" ],
                                                        ],
                                                ],
                                                [
                                                        [ "return" ],
                                                ],
                                        ],
+                                       [ "if",
+                                               [ "regex", "DEVNAME", "^ttyS" ],
+                                               [ "makedev", "/dev/%DEVNAME%", "0664" ],
+                                       ],
                                        [ "if",
                                                [ "has", "DEVNAME" ],
                                                [ "makedev", "/dev/%DEVNAME%", "0644" ],
                        ]
                ]
        } ],
-       [ "if",
-               [ "eq", "SUBSYSTEM", "platform" ],
-               [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
-       ],
        [ "if",
                [ "and",
                        [ "has", "BUTTON" ],
                        [ "eq", "SUBSYSTEM", "button" ],
                ],
-               [ "exec", "/etc/rc.button/%BUTTON%" ]
+               [ "button", "/etc/rc.button/%BUTTON%" ]
        ],
        [ "if",
-               [ "or",
-                       [ "eq", "SUBSYSTEM",
-                               [ "net", "input", "usb", "ieee1394", "block", "atm", "zaptel", "button" ],
-                       ],
-                       [ "and",
-                               [ "eq", "SUBSYSTEM", "tty" ],
-                               [ "regex", "DEVNAME", "^ttyUSB" ],
+               [ "and",
+                       [ "eq", "SUBSYSTEM", "usb-serial" ],
+                       [ "regex", "DEVNAME",
+                               [ "^ttyUSB", "^ttyACM" ]
                        ]
                ],
-               [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
+               [ "exec", "/sbin/hotplug-call", "tty" ],
+               [ "if",
+                       [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
+                       [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
+               ]
        ],
 ]