recipes-bsp: Add support for gpio-shutdown

- Feature is enabled with ENABLE_GPIO_SHUTDOWN variable
- Include the gpio-shutdown overlay
- If using SysV init include the additional keymap and inittab entries
  to bind the KEY_POWER event
- Systemd init does not require any additional bindings

Signed-off-by: Otto Esko <otto.esko@gmail.com>
This commit is contained in:
Otto Esko
2021-12-04 18:51:54 +02:00
committed by Andrei Gherzan
parent 58cc662539
commit bf2d2eae4e
5 changed files with 66 additions and 0 deletions
@@ -0,0 +1,2 @@
# Action on special keypress (Key Power)
kb::kbrequest:/sbin/shutdown -t1 -a -h -P now
@@ -0,0 +1,13 @@
#!/bin/sh
##
# Bind the gpio-shutdown keycode as Keyboard signal and load it to the
# keymap during startup.
##
case "$1" in
start)
# Inject the gpio keycode to keymap
echo "keycode 116 = KeyboardSignal" | loadkeys
;;
*)
;;
esac