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.

Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: I108f75d74b0c2264af8d41299d2a0c2809edccc4
diff --git a/recipes-phosphor/state/phosphor-post-code-manager_git.bb b/recipes-phosphor/state/phosphor-post-code-manager_git.bb
index 9d08084..075e06c 100644
--- a/recipes-phosphor/state/phosphor-post-code-manager_git.bb
+++ b/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"