How to setup the beaglebone black and green to use the on board boot button

In order to use the boot button as marked here

  1. Get the current lxqt image from Debian_Image_Testing_Snapshots , and use the explination on that page to install it on your board.

  2. create this file to issue the setup on boot using systemd:
    The file is /lib/systemd/system/button_gpio.service

[Unit]
Description=Setup on-board button GPIO
Requires=capemgr.service
After=capemgr.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/root/button_gpio.sh

[Install]
WantedBy=multi-user.target

  1. Now create the /root/button_gpio.sh script to do the setup:

#!/bin/sh
grep -q univ-all /sys/devices/platform/bone_capemgr/slots || config-pin overlay univ-all
[ -f ‘/sys/class/gpio/gpio72’ ] || echo 72 >/sys/class/gpio/export
echo in >/sys/class/gpio/gpio72/direction
/usr/local/bin/config-pin P8_43 in+

now make this script executable:
$ chmod +x /root/button_gpio.sh

Now you can click the button and see this file change:
$ cat /sys/class/gpio/gpio72/value

Good luck
Niv Gal Waizer