I have a embedded system that needs to be power off itself after shutdown. To power off, the Linux should send a command via an i2c to another device to power off the Linux board.
So to shutdown and power off the Linux board, I should do:
Shutdown Linux(so it became safe to power down the board.
Send a command to a power management device to power off the Linux board.
I already wrote a simple code that can be run in Linux and turn off the board.
How can I setup the Linux that it runs this program after it became safe to power off the board?