17-Sep-2016
NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the
FAQ for more details.
I went to the trouble of
making an external power button for my Odroid XU4 and then found out that out of the box
DietPi completely ignores this button being pressed. Luckily there is a way to make the
OS shut down after the power button is pressed.
Here's what I did to check if the power button presses do anything. I needed to install
evtest first.
After it was installed, I ran it and got the following output:
Selecting '0' gave me this...
...and when I triggered the power button, a bunch of events were fired, so I was on the right track!
I came across
this forum post that gave me some good leads, but it wasn't for an
XU4, so using the
default systemd power switch rules I came up with something that should work on the
XU4...
The above was saved to
/etc/udev/rules.d/70-power-switch-odroidxu4.rules and then I ran the following commands to reload the rules...
Then as soon as I triggered the power button, my
XU4 started shutting down. Neat!
-i
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
If you spot something out of place, please do let me know.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to
this disclaimer.
Igor Kromin
Other posts you may like...