OpenWrt Forum Archive

Topic: Hotplug.d and subsystem

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I need a set of script that work in this way:
1. Boot system;
2. Detect interfaces, the associated mac address and put this informations in a file;
3. Only for eth0 detect if it can be configued via dhcp or not.
4. In according to step 3, rebuild network uci config file automatically.

To do this i think that the right way is to use hotplug but i have some problem because i'm not able to register a new subsystem "customized" for my hotplug events, but i'm only able to use "net" subsystem to work with my eth devices.

My hotplug.d structure is:

/etc/hotplug.d/
    net
        01-dhcp_detect
    platform
    iface
    customized
        00-device_detect

now i want that when a new interface is added are executed before all script in customized subsystem and after the script located in net subsystem in according on normal boot of openwrt.
I tried to place another call of "hotplug-call" before the already present in my /etc/init.d/boot but this won't fix my problem.
My hotplug-call seems to be done but $INTERFACE in my 00-device_detect is NULL. Why? Only subsystem net can expect $INTERFACE

Please help me!

Rgds

(Last edited by tonyputi on 20 Apr 2011, 21:17)

The discussion might have continued from here.