Power supply monitor recipe, service, and conf

Add the Witherspoon power supply monitor application, service file, and
configuration files to the witherspoon-pfault-analysis recipe.

Moved OBMC_POWER_SUPPLY_INSTANCES to the global metadata so it can be
shared between recipes.

Resolves: openbmc/openbmc#1731

Depends-On: Ie364a3dc5b7f19cbc587450fc54f231d1ec280f7

Change-Id: I340a1d48a979a97624843e59a5ab1b1ad04056bb
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/meta-witherspoon/recipes-phosphor/power/witherspoon-pfault-analysis.bb b/meta-witherspoon/recipes-phosphor/power/witherspoon-pfault-analysis.bb
index f9b0e2a..2f46f78 100644
--- a/meta-witherspoon/recipes-phosphor/power/witherspoon-pfault-analysis.bb
+++ b/meta-witherspoon/recipes-phosphor/power/witherspoon-pfault-analysis.bb
@@ -32,3 +32,15 @@
 
 SYSTEMD_SERVICE_${PN} += "${SEQ_MONITOR_SVC} ${SEQ_PGOOD_SVC}"
 SYSTEMD_LINK_${PN} += "${SEQ_MONITOR_FMT} ${SEQ_PGOOD_FMT}"
+
+PSU_MONITOR_TMPL = "witherspoon-power-supply-monitor@.service"
+PSU_MONITOR_INSTFMT = "witherspoon-power-supply-monitor@{0}.service"
+PSU_MONITOR_TGT = "${SYSTEMD_DEFAULT_TARGET}"
+PSU_MONITOR_FMT = "../${PSU_MONITOR_TMPL}:${PSU_MONITOR_TGT}.requires/${PSU_MONITOR_INSTFMT}"
+
+FILES_witherspoon-psu-monitor = "${sbindir}/witherspoon-psu-monitor"
+SYSTEMD_SERVICE_${PN} += "${PSU_MONITOR_TMPL}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'PSU_MONITOR_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"
+
+PSU_MONITOR_ENV_FMT = "obmc/power-supply-monitor/power-supply-monitor-{0}.conf"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'PSU_MONITOR_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"