sync bmc time from ipmb host
This script runs at startup as systemd service.
It checks if the bmc time is in sync from NTP server.
otherwise it reads the host time via ipmb interface
and updates as bmc time.
This change was tested and verified in yosemitev2 and tiogapass
platforms.
Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: I8c937c16415b2dd05d05155facadc0bed797db07
diff --git a/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/bmc-set-time.service b/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/bmc-set-time.service
new file mode 100644
index 0000000..e148b53
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/bmc-set-time.service
@@ -0,0 +1,12 @@
+[Unit]
+Description= Sync time from host via ipmb
+Wants=ipmb.service xyz.openbmc_project.Network.service
+After=ipmb.service xyz.openbmc_project.Network.service
+
+[Service]
+Type=onshot
+ExecStart=/usr/libexec/set-bmc-time-from-host
+RemainAfterExit=no
+
+[Install]
+WantedBy=multi-user.target