clear host-on file when host stopped

This file is currently removed in the chassis poweroff target within the
op-wait-power-off service. This was fine until our recent introduction of
warm resets.

Here's the scenario that causes trouble:

- Reboot BMC with host up, /run/openbmc/host@0-on is created to indicate
  the host is already on and the services involved in booting the host
  should do nothing.
- Now issue a warm reboot of the host. Because the chassis power is not
  cycled on a warm reboot, the service is not run which clears the
  host@0-on file. This then leads to the service responsible for starting
  the host not running.

The solution is to clear this file when the host is stopped.

The removal of the file should stay within chassis poweroff target to
handle corner cases where only a hard power off is done to the system.

Tested:
Built image with fix and verified that test scenario now works and that
file was cleared as expected as a part of the warm reboot.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I6383d96f7a6be32ca19b998d9cd1cce81a307412
1 file changed
tree: be822131d8e57e88bf20bc069a26ba4dcc8a5222
  1. phalerror/
  2. procedures/
  3. test/
  4. .clang-format
  5. .gitignore
  6. bootstrap.sh
  7. cfam_access.cpp
  8. cfam_access.hpp
  9. configure.ac
  10. ext_interface.cpp
  11. ext_interface.hpp
  12. filedescriptor.cpp
  13. filedescriptor.hpp
  14. gen_makefile.sh
  15. LICENSE
  16. MAINTAINERS
  17. Makefile.am
  18. Makefile.generated.in
  19. nmi_interface.cpp
  20. nmi_interface.hpp
  21. nmi_main.cpp
  22. op-cfam-reset.service.in
  23. op-continue-mpreboot@.service.in
  24. op-enter-mpreboot@.service.in
  25. op-stop-instructions@.service.in
  26. p10_cfam.hpp
  27. p9_cfam.hpp
  28. pcie-poweroff@.service.in
  29. proc_control.cpp
  30. README.md
  31. registration.cpp
  32. registration.hpp
  33. set-spi-mux.service.in
  34. targeting.cpp
  35. targeting.hpp
  36. xyz.openbmc_project.Control.Host.NMI.service.in
README.md

Contains procedures that interact with the OpenPower nest chipset.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To build with phal feature:
    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS} --enable-phal --enable-openfsi
    3. make

To clean the repository run `./bootstrap.sh clean`.