Put soft power off service in host shutdown target

This will ensure we give the host a chance to shutdown
properly when a power off is requested

Change-Id: I3e58a1ad6a187f63dc27448a1f6c2ac25d4a58e3
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
index 9d23d1e..21b7af5 100644
--- a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
@@ -11,6 +11,7 @@
 inherit obmc-phosphor-ipmiprovider-symlink
 inherit phosphor-ipmi-host
 inherit pythonnative
+inherit obmc-phosphor-systemd
 
 DEPENDS += "phosphor-logging"
 DEPENDS += "phosphor-mapper"
@@ -19,6 +20,7 @@
 DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
 DEPENDS += "sdbusplus"
 DEPENDS += "phosphor-dbus-interfaces"
+DEPENDS += "obmc-targets"
 
 RDEPENDS_${PN}-dev += "phosphor-logging"
 RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
@@ -59,3 +61,9 @@
 
 # Soft Power Off
 RDEPENDS_${PN} += "phosphor-mapper"
+
+# install the soft power off service in the host shutdown target
+SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
+SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
+SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
+SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"