1

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:

  1. Shutdown Linux(so it became safe to power down the board.

  2. 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?

4
  • Is this question about powering down a system and the interaction between the system board and the PSU to do that, or trying to remove the external power feed to the unit after the system is shut down? Can you explain your shut down code vs. the need to run it after the system is shut off or are you just referring to running it when the housekeeping is done (saving things from RAM, unmounting disks, etc.)?
    – fixer1234
    Nov 12, 2014 at 20:12
  • @fixer1234 I am trying to simulate the same interaction that Linux on a PC do to power off the computer after a shutdown on my embedded system. I have Ubuntu Linux running on m board. I can power off the board by sending a command to a power management device via i2c and I can shutdown the Linux My question is how Linux send power off command to PSU on PC? can I use the same technique on my Linux?
    – mans
    Nov 12, 2014 at 21:11
  • So on an embedded system, it's stripped down to the point that you need to code even fundamental OS tasks like that? Linux is all open code. Is your task to identify the module that contains that function and look at the source code?
    – fixer1234
    Nov 12, 2014 at 21:26
  • Don't know which init system you are using, but perhaps unix.stackexchange.com/questions/56414/eject-cd-on-shutdown gives you some clues.
    – mpy
    Nov 12, 2014 at 21:32

0

You must log in to answer this question.

Browse other questions tagged .