[OpenWrt-Devel] [PATCH libubox] hotplug: add hotplug_call() helper

John Crispin john at phrozen.org
Fri Dec 7 03:42:15 EST 2018

On 07/12/2018 09:39, Rafał Miłecki wrote:
> On 2018-12-07 04:41, Yousong Zhou wrote:
>> On Thu, 6 Dec 2018 at 20:42, Rafał Miłecki <zajec5 at gmail.com> wrote:
>>> From: Rafał Miłecki <rafal at milecki.pl>
>>> This new function imlements common code needed to run /etc/hotplug.d/
>>> listeners. It allows specifying subsystem and environment strings as
>>> commonly used in the hotplug.d.
>> hotplug-call is currently a OpenWrt-specific shell script from
>> base-files.  A library function's dependence on exact name and path of
>> non-standard executable does not seem fit.
> You're probably right, I guess the best solution would be to implement
> hotplug-call script behavior directly in the libubox library.
>> Hotplug events from the kernel is already being handled by
>> hotplug.json script.  Events from non-standard subsystem like "iface"
>> as defined by netifd are generated and handled fine just by itself
>> [1].  As such, I cannot find enough other places needing this function
>> to make it into libubox.
> We could make netifd use that hotplug_call() helper, but now I noticed
> that netifd simply uses setenv() after the fork(). That may be simpler
> than building all that envp array.
> I'm not sure now if it's better to work on:
> 1) Improved (native) hotplug_call() implementation in the libubox
> 2) Original idea of doing fork() in the fstools / block + setenv()
> Implementing hotplug_call() was originally suggested by John, let's see
> what's his opinion too.

I was simply thinking of making the code reusable. i do understand the 
concens. I dont really hold a really strong position on this. if you 
feel that it is better to implment this inside blockd directly or any 
other way, feel free to do so.


>>  [1]
>> https://git.openwrt.org/?p=project/netifd.git;a=blob;f=interface-event.c;h=a40f6dc883d3a3654d73d0592cd7eb65c2a8de85;hb=HEAD#l45 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list