phosphor-state-manager: move host symlinks to correct subpkg

The `multi-user.target.requires/...Host@{i}.service` symlinks were
being added to the `obmc-targets` sub-package, but nothing explicitly
depends on the `host` sub-package.  On systems that do not include
the `host` sub-package, this could result in broken symlinks, and
on systems which do not use the targets it can result in the `host`
daemon not starting.

Move these `Host@{i}.service` symlinks into the `host`
sub-package since that is where the original service file resides.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I43aa5fdbe73f0af3c5d213e45e3a02f2dc093d79
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
index 6b0bda0..52bbb05 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
@@ -1,5 +1,4 @@
 DEFAULT_TARGETS = " \
-    multi-user.target.requires/xyz.openbmc_project.State.Host@{}.service \
     multi-user.target.requires/obmc-host-reset@{}.target \
     multi-user.target.requires/phosphor-discover-system-state@{}.service \
     obmc-chassis-poweron@{}.target.wants/phosphor-reset-host-recovery@{}.service \
@@ -62,6 +61,18 @@
     done
 }
 
+pkg_postinst:${PN}-host:append() {
+    for i in ${OBMC_HOST_INSTANCES};
+    do
+        mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
+
+        LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service"
+        TARGET="../xyz.openbmc_project.State.Host@.service"
+        ln -s $TARGET $LINK
+
+    done
+}
+
 pkg_prerm:${PN}-obmc-targets:append() {
 
     for i in ${OBMC_HOST_INSTANCES};
@@ -95,3 +106,13 @@
 
     done
 }
+
+pkg_prerm:${PN}-host:append() {
+    for i in ${OBMC_HOST_INSTANCES};
+    do
+
+        LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service"
+        rm $LINK
+
+    done
+}