[OpenWrt-Devel] [PATCH] procd: hotplug.json: allow passing hotplug events from all subsystems

Luiz Angelo Daros de Luca luizluca at gmail.com
Sat Nov 28 23:10:15 EST 2015


John,

How about generate the subsystem list from /etc/hotplug.d dirs. The list
could be loaded at startup and refreshed the same way hotplug.json is (
which might be "never" as procd does not have an "init q").

Regards,

Luiz

Em sáb, 28 de nov de 2015 21:14, John Crispin <blogic at openwrt.org> escreveu:

> Hi Yousong,
>
> On 28/11/2015 05:22, Yousong Zhou wrote:
> > 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.
> >
>
> i am not sure if this is a good idea. there are thousands of events
> being broadcast, specially during boot and we really want to avoid
> respawning the script helper for each one of them. i was under the
> impression that we had an include directive that allowed us to include
> board/target specific json files. however i am failing to find the code
> that does this so the feature might not actually be implemented yet.
> i'll need to have a closer look at this the next days.
>
>         John
>
> > Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
> > ---
> >  package/system/procd/files/hotplug.json | 9 ++-------
> >  1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/package/system/procd/files/hotplug.json
> b/package/system/procd/files/hotplug.json
> > index 27b4836..bad2340 100644
> > --- a/package/system/procd/files/hotplug.json
> > +++ b/package/system/procd/files/hotplug.json
> > @@ -69,18 +69,13 @@
> >               [ "button", "/etc/rc.button/%BUTTON%" ]
> >       ],
> >       [ "if",
> > -             [ "eq", "SUBSYSTEM",
> > -                     [ "net", "input", "usb", "usbmisc", "ieee1394",
> "block", "atm", "zaptel", "tty", "button" ]
> > -             ],
> > -             [ "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" ],
> > +             [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
> >       ],
> >  ]
> >
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-- 

Luiz Angelo Daros de Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20151129/98653cea/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list