Witherspoon: Add sync manager

Add the sync manager which watches for files to be synced
to the alternate BMC chip.

Change-Id: I543dacf389629c024b35d1b855745bbcc0bbd848
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager.bb b/common/recipes-phosphor/flash/phosphor-software-manager.bb
index 919d0ff..746daeb 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager.bb
+++ b/common/recipes-phosphor/flash/phosphor-software-manager.bb
@@ -11,6 +11,7 @@
     ${PN}-version \
     ${PN}-download-mgr \
     ${PN}-updater \
+    ${PN}-sync \
 "
 PACKAGES =+ "${SOFTWARE_MGR_PACKAGES}"
 PACKAGES_remove = "${PN}"
@@ -24,6 +25,7 @@
 SYSTEMD_PACKAGES = ""
 
 PACKAGECONFIG[verify_signature] = "--enable-verify_signature,--disable-verify_signature"
+PACKAGECONFIG[sync_bmc_files] = "--enable-sync_bmc_files,--disable-sync_bmc_files"
 
 inherit autotools pkgconfig
 inherit obmc-phosphor-dbus-service
@@ -69,9 +71,11 @@
     ${sbindir}/obmc-flash-bmc \
     /usr/local \
     "
+FILES_${PN}-sync += "${sbindir}/phosphor-sync-software-manager"
 DBUS_SERVICE_${PN}-version += "xyz.openbmc_project.Software.Version.service"
 DBUS_SERVICE_${PN}-download-mgr += "xyz.openbmc_project.Software.Download.service"
 DBUS_SERVICE_${PN}-updater += "xyz.openbmc_project.Software.BMC.Updater.service"
+DBUS_SERVICE_${PN}-sync += "xyz.openbmc_project.Software.Sync.service"
 
 SYSTEMD_SERVICE_${PN}-updater += " \
     obmc-flash-bmc-ubirw.service \
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service
new file mode 100644
index 0000000..1ff33a2
--- /dev/null
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Phosphor Sync Manager that syncs files to the alternate BMC chip
+
+[Service]
+ExecStart=/usr/bin/env phosphor-sync-software-manager
+SyslogIdentifier=phosphor-sync-software-manager
+Restart=always
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}