wiki:OpenWrt/hotplug

Version 3 (modified by Tim Harvey, 3 years ago) ( diff )

update link to button-hotplug-gw script

OpenWrt hotplug

Our modern OpenWrt based BSP's use OpenWrt procd as PID1. One of procd's features is to catch messages from the kernel and act upon them, much in the way a conventional linux system uses a hotplug helper and udev. The /etc/hotplug.json file configures how various events are handled:

  • using makedev to create device nodes in /dev on 'add' events and removing the nodes on 'remove' events
  • facilitate firmware loading
  • calling /sbin/hotplug-call on platform subsystem events
  • calling /etc/rc.button/$BUTTON on button events
  • calling /sbin/hotplug-call on various subsystem events (such as net, input, usb, block, atm, tty, button)

Button events:

  • /sbin/hotplug-call will have the following defined:
    • BUTTON - button name
    • ACTION - pressed|released
    • SEQNUM - a numeric value that increments with the event message
    • SEEN - number of seconds since last button event from driver (can be used to determine button held time)
  • see button-hotplug-gw script and button-hotplug-gw config
Note: See TracWiki for help on using the wiki.