I am currently working on a VPN router using a Raspberry Pi 3 and wish to add a power button to turn it off with a little grace. I found the gpio-shutdown overlay in the overlays folder and have been trying to make it work without success.
I have already added the dtoverlay=gpio-shutdown on /boot/config.txt without it having any effect. After I installed the kmod-input-gpio-keys package, the kernel shows a message saying that the button is now being recognized, but still nothing happens when I press it.
What I want to do is, I press the button and the shutdown process begins. I know I could probably make a daemon and have it constantly polling the GPIO, it just sounded like the kernel overlay was a "plug-and-play" solution for doing exactly that.
I found the solution. I was missing the kmod-gpio-button-hotplug packaged. After installing it, all I had to do was call dtoverlay=gpio-shutdown with the correct options at the end of the /boot/config.txt file