procd: hotplug.json: allow passing hotplug events from all subsystems
authorJohn Crispin <john@openwrt.org>
Fri, 26 Feb 2016 08:35:43 +0000 (08:35 +0000)
committerJohn Crispin <john@openwrt.org>
Fri, 26 Feb 2016 08:35:43 +0000 (08:35 +0000)
There are time that programs need to be notified of events from
subsystems that are not enumerated in the .json definition, e.g. QEMU
guest agent by default requires /dev/virtio-ports/org.qemu.guest_agent.0
which is a symlink to /dev/vportMpN from virtio-ports subsystem.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
SVN-Revision: 48799

package/system/procd/files/hotplug.json

index 516a122f0ebf05ba0d52e831bd0f4c8dbfae7d54..e2f16045424ef880d62ed8f8942b5e4696d1c598 100644 (file)
                        ]
                ]
        } ],
-       [ "if",
-               [ "eq", "SUBSYSTEM", "platform" ],
-               [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
-       ],
        [ "if",
                [ "and",
                        [ "has", "BUTTON" ],
                ],
                [ "button", "/etc/rc.button/%BUTTON%" ]
        ],
-       [ "if",
-               [ "eq", "SUBSYSTEM",
-                       [ "net", "input", "usb", "usbmisc", "ieee1394", "block", "atm", "zaptel", "tty", "button", "sound" ]
-               ],
-               [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
-       ],
        [ "if",
                [ "and",
                        [ "eq", "SUBSYSTEM", "usb-serial" ],
                        [ "regex", "DEVNAME",
                                [ "^ttyUSB", "^ttyACM" ]
-                       ],
+                       ]
                ],
-               [ "exec", "/sbin/hotplug-call", "tty" ]
+               [ "exec", "/sbin/hotplug-call", "tty" ],
+               [ "if",
+                       [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
+                       [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
+               ]
        ],
 ]