I am trying to find the routine which is monitoring the shutdown button (input 6) on the Sonar board.
Also, which routine actually generates the system shutdown command?
I see where pi_sonar is using the GPIO signals from the sonar board to handle the sonar sensors, but I cannot find any code/script/module which is monitoring the shutdown button GPIO input.
[UPDATE]
Looks like it is handled by an overlay and some functionality intrinsic to Linux or systemd:
/boot/config.txt
dtoverlay=ubiquity-led-buttons
The Raspberry Pi info states that a shutdown button can be set up by:
dtoverlay=gpio-shutdown
so I assume that ‘dtoverlay=ubiquity-led-buttons’ is accomplishing the same thing in some manner.
This assumption is backed up by Ubiquity’s instruction to remove ‘dtoverlay=ubiquity-led-buttons’ to free up the GPIO 6 pin for other uses.
Now to find the source for ‘/boot/overlays/ubiquity-led-buttons.dtbo’ or convert it back to human-readable.
I found the source for ‘/boot/overlays/ubiquity-led-buttons.dtbo’ at: