diff options
Diffstat (limited to 'meta-raspberrypi/recipes-bsp/gpio-shutdown/files')
-rw-r--r-- | meta-raspberrypi/recipes-bsp/gpio-shutdown/files/bind_gpio_shutdown.tab | 2 | ||||
-rw-r--r-- | meta-raspberrypi/recipes-bsp/gpio-shutdown/files/gpio-shutdown-keymap.sh | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/meta-raspberrypi/recipes-bsp/gpio-shutdown/files/bind_gpio_shutdown.tab b/meta-raspberrypi/recipes-bsp/gpio-shutdown/files/bind_gpio_shutdown.tab new file mode 100644 index 0000000000..00cc4857d8 --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/gpio-shutdown/files/bind_gpio_shutdown.tab @@ -0,0 +1,2 @@ +# Action on special keypress (Key Power) +kb::kbrequest:/sbin/shutdown -t1 -a -h -P now diff --git a/meta-raspberrypi/recipes-bsp/gpio-shutdown/files/gpio-shutdown-keymap.sh b/meta-raspberrypi/recipes-bsp/gpio-shutdown/files/gpio-shutdown-keymap.sh new file mode 100644 index 0000000000..bae50daf14 --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/gpio-shutdown/files/gpio-shutdown-keymap.sh @@ -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 |