meta-phosphor: Add post code support for multi host in meta-phosphor.

Added implementation to handle post codes from multiple host to BMC with
multi process approach. Each process handles post codes for corresponding host.

TESTED : Built the openbmc image targetting Facebook YosemiteV2 hardware.
Verified all the host's postcodes stored in corresponding host directories.

(From meta-phosphor rev: 57042e2fdb40b185721d7a8e9fc54d56d382b083)

Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: I490558737b601fccb74da3b2dbef5e173343683f
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
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 9d08084..075e06c 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
@@ -15,10 +15,20 @@
 
 inherit cmake pkgconfig systemd
 
-SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.State.Boot.PostCode.service"
+
+def get_service(d):
+    if(d.getVar('OBMC_HOST_INSTANCES') == '0'):
+      return "xyz.openbmc_project.State.Boot.PostCode.service"
+    else:
+      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 \
     phosphor-logging \
     "
+
+FILES_${PN}  += "${systemd_system_unitdir}/xyz.openbmc_project.State.Boot.PostCode@.service"
+FILES_${PN}  += "${systemd_system_unitdir}/xyz.openbmc_project.State.Boot.PostCode.service"