wiki:OpenWrt/hotplug

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
Last modified 3 years ago Last modified on 09/10/2021 07:54:19 PM
Note: See TracWiki for help on using the wiki.