| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = OpenWrt hotplug = |
| | 4 | 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 |
| | 5 | events are handled: |
| | 6 | * using makedev to create device nodes in /dev on 'add' events and |
| | 7 | removing the nodes on 'remove' events |
| | 8 | * facilitate firmware loading |
| | 9 | * calling /sbin/hotplug-call on platform subsystem events |
| | 10 | * calling /etc/rc.button/$BUTTON on button events |
| | 11 | * calling /sbin/hotplug-call on various subsystem events (such as |
| | 12 | net, input, usb, block, atm, tty, button) |
| | 13 | |
| | 14 | Button events: |
| | 15 | * /sbin/hotplug-call will have the following defined: |
| | 16 | - BUTTON - button name |
| | 17 | - ACTION - pressed|released |
| | 18 | - SEQNUM - a numeric value that increments with the event message |
| | 19 | - SEEN - number of seconds since last button event from driver (can be used to determine button held time) |
| | 20 | * see [http://trac.gateworks.com/browser/openwrt/packages/gateworks/button-hotplug-gw/files/hotplug button-hotplug-gw script] and [wiki:OpenWrt/gpio#button-hotplug-gw button-hotplug-gw config] |
| | 21 | |