mmc: Add HardwareIsolation service to restart if factory resets

- The HardwareIsolation (daemon) service is dependent on the host partition
  to share the host isolated hardware entries through the external
  interface (for example Redfish).

- But, If we attempted to do the factory reset then, the host partition
  gets deleted and recreated back so due to this the HardwareIsolation
  daemon is unable to handle the host partition.

- Fixed the above mentioned issue by restarting the HardwareIsolation daemon.

- Note, start unit won't help if the service is already running like a daemon
  so, we need to use restart method for the HardwareIsolation so modified
  the code to use a method based on the services that's need to consider
  in the host factory reset.

Tested:

- Verified by the host factory reset.

```
Apr 20 11:59:33 bmc_system phosphor-log-manager[339]: Deleting all log entries
Apr 20 11:59:33 bmc_system systemd[1]: Starting Setup Host FW directories...
Apr 20 11:59:33 bmc_system systemd[1]: Starting Create patch directory for Host FW...
Apr 20 11:59:33 bmc_system systemd[1]: Stopping OpenPOWER Host HardwareIsolation...
Apr 20 11:59:33 bmc_system systemd[1]: Starting Reset PHYP-NVRAM-CKSUM file...
Apr 20 11:59:33 bmc_system systemd[1]: Starting Reset PHYP-NVRAM file...
Apr 20 11:59:33 bmc_system systemd[1]: org.open_power.HardwareIsolation.service: Deactivated successfully.
Apr 20 11:59:33 bmc_system systemd[1]: Stopped OpenPOWER Host HardwareIsolation.
Apr 20 11:59:33 bmc_system systemd[1]: pldm-reset-phyp-nvram-cksum.service: Deactivated successfully.
Apr 20 11:59:33 bmc_system systemd[1]: Finished Reset PHYP-NVRAM-CKSUM file.
Apr 20 11:59:33 bmc_system systemd[1]: Starting Create empty PHYP-NVRAM-CKSUM file...
Apr 20 11:59:33 bmc_system dd[9688]: 1+0 records in
Apr 20 11:59:33 bmc_system dd[9688]: 1+0 records out
Apr 20 11:59:33 bmc_system systemd[1]: pldm-create-phyp-nvram-cksum.service: Deactivated successfully.
Apr 20 11:59:33 bmc_system systemd[1]: Finished Create empty PHYP-NVRAM-CKSUM file.
Apr 20 11:59:33 bmc_system systemd[1]: obmc-flash-bios-patch.service: Deactivated successfully.
Apr 20 11:59:33 bmc_system systemd[1]: Finished Create patch directory for Host FW.
Apr 20 11:59:33 bmc_system systemd[1]: pldm-reset-phyp-nvram.service: Deactivated successfully.
Apr 20 11:59:33 bmc_system systemd[1]: Finished Reset PHYP-NVRAM file.
Apr 20 11:59:34 bmc_system systemd[1]: Starting Create empty PHYP-NVRAM file...
Apr 20 11:59:39 bmc_system systemd[1]: obmc-flash-bios-init.service: Deactivated successfully.
Apr 20 11:59:39 bmc_system systemd[1]: Finished Setup Host FW directories.
Apr 20 11:59:39 bmc_system systemd[1]: Starting Set POWER host firmware well-known names...
Apr 20 11:59:39 bmc_system dd[9692]: 145408+0 records in
Apr 20 11:59:39 bmc_system dd[9692]: 145408+0 records out
Apr 20 11:59:39 bmc_system systemd[1]: pldm-create-phyp-nvram.service: Deactivated successfully.
Apr 20 11:59:39 bmc_system systemd[1]: Finished Create empty PHYP-NVRAM file.
Apr 20 11:59:41 bmc_system systemd[1]: openpower-process-host-firmware.service: Deactivated successfully.
Apr 20 11:59:41 bmc_system systemd[1]: Finished Set POWER host firmware well-known names.
Apr 20 11:59:41 bmc_system systemd[1]: Starting Update BIOS attr table with host firmware well-known names...
Apr 20 11:59:41 bmc_system systemd[1]: openpower-update-bios-attr-table.service: Deactivated successfully.
Apr 20 11:59:41 bmc_system systemd[1]: Finished Update BIOS attr table with host firmware well-known names.
Apr 20 11:59:41 bmc_system systemd[1]: Starting OpenPOWER Host HardwareIsolation...
Apr 20 11:59:41 bmc_system systemd[1]: Started OpenPOWER Host HardwareIsolation.
```

Signed-off-by: Ramesh Iyyar <rameshi1@in.ibm.com>
Change-Id: I37ae2862d105ff3901e408df15f58d7653e95ad3
1 file changed
tree: 00ce039055e3806f72f5a52e3bec18f1c3522261
  1. dbus/
  2. mmc/
  3. static/
  4. test/
  5. ubi/
  6. vpnor/
  7. .clang-format
  8. .gitignore
  9. .shellcheck
  10. activation.cpp
  11. activation.hpp
  12. functions.cpp
  13. functions.hpp
  14. generate-tar
  15. generate-ubi
  16. image_verify.cpp
  17. image_verify.hpp
  18. item_updater.cpp
  19. item_updater.hpp
  20. item_updater_main.cpp
  21. LICENSE
  22. MAINTAINERS
  23. meson.build
  24. meson_options.txt
  25. msl_verify.cpp
  26. msl_verify.hpp
  27. msl_verify_main.cpp
  28. op-pnor-msl.service
  29. openpower-pnor-update@.service
  30. org.open_power.Software.Host.Updater.service
  31. OWNERS
  32. README.md
  33. utils.cpp
  34. utils.hpp
  35. version.cpp
  36. version.hpp
README.md

openpower-pnor-code-mgmt

OpenPower PNOR (Processor NOR) Code Management provides a set of host software management applications for OpenPower systems. The host firmware is stored on the PNOR chip. More information can be found at Software Architecture or Host Code Update

To Build

To build this package, do the following steps:

  1. meson build
  2. ninja -C build

To clean the repository run rm -r build.