phosphor-post-code-manager: install templated service correctly

The latest yocto update is flagging an error on machines using this
recipe. The reason appears to be because the templated services are
added to the SYSTEMD_SERVICE variable but they are not properly
installed into the filesystem.

Install the templated service file utilizing a more direct and tested
method.

Tested:
- Confirmed service file installed in rootfs as expected
```
/rootfs/usr/lib/systemd/system/multi-user.target.wants/xyz.openbmc_project.State.Boot.PostCode@0.service
```

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I3bdd15b3960a910ccc4b9bcd0e03df1613687ba1
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb b/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb
index b0e11b4..1ed1598 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb
@@ -13,10 +13,6 @@
 
 inherit meson pkgconfig systemd
 
-def get_service(d):
-    return " ".join(["xyz.openbmc_project.State.Boot.PostCode@{}.service".format(x) for x in d.getVar('OBMC_HOST_INSTANCES').split()])
-
-SYSTEMD_SERVICE:${PN} = "${@get_service(d)}"
 DEPENDS += " \
     sdbusplus \
     phosphor-dbus-interfaces \
@@ -25,3 +21,22 @@
     "
 FILES:${PN}  += "${systemd_system_unitdir}/xyz.openbmc_project.State.Boot.PostCode@.service"
 FILES:${PN}  += "${systemd_system_unitdir}/xyz.openbmc_project.State.Boot.PostCode.service"
+
+pkg_postinst:${PN}:append() {
+    mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
+    for i in ${OBMC_HOST_INSTANCES};
+    do
+        LINK="$D$systemd_system_unitdir/multi-user.target.wants/xyz.openbmc_project.State.Boot.PostCode@${i}.service"
+        TARGET="..//xyz.openbmc_project.State.Boot.PostCode@.service"
+        ln -s $TARGET $LINK
+    done
+}
+
+pkg_prerm:${PN}:append() {
+    for i in ${OBMC_HOST_INSTANCES};
+    do
+        LINK="$D$systemd_system_unitdir/multi-user.target.wants/xyz.openbmc_project.State.Boot.PostCode@${i}.service"
+        rm $LINK
+    done
+}
+