Implement post code manager
This depends on interfaces definition:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/20474
Implement method and properties defined in PostCode.interface.yaml
under phosphor-dbus-interfaces/xyz/openbmc_project/State/Boot
1. Method: std::vector<uint64_t> PostCode::getPostCodes(uint16_t index)
2. Properties: CurrentBootCycleIndex/MaxBootCycleNum
Test-By:
Every cycle post codes is saved in "/var/lib/phosphor-post-code-manager"
"1" file is saved all post codes for cycle 1
"2" file is saved all post codes for cycle 2
"CurrentBootCycleIndex" file is saved the current boot cycle number.
root@wolfpass:/var/lib/phosphor-post-code-manager# ls
1 2 CurrentBootCycleIndex
Change-Id: Ia89b9121983261fef5573092d890beb84626ceeb
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
diff --git a/service_files/xyz.openbmc_project.State.Boot.PostCode.service b/service_files/xyz.openbmc_project.State.Boot.PostCode.service
new file mode 100644
index 0000000..67bc43f
--- /dev/null
+++ b/service_files/xyz.openbmc_project.State.Boot.PostCode.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Post code manager
+
+[Service]
+ExecStart=/usr/bin/env post-code-manager
+SyslogIdentifier=post-code-manager
+Type=dbus
+BusName=xyz.openbmc_project.State.Boot.PostCode
+
+[Install]
+WantedBy=obmc-standby.target