phosphor-ipmi-host: Add entity config default

To provide a custom entity configuration, provide
a virtual phosphor-ipmi-entity-config. The entity.yaml file contains
metadata information for the SDR type 0x08h (Entity Association Record)

(From meta-phosphor rev: 47f26214a916246eeb52a9c2f4045e6375fa0bfe)

Change-Id: I812d5805edd547c2780604119bd6ae3f969d9886
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index bac3ad1..b1ccbcd 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -168,6 +168,13 @@
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-channel-config ?= "phosphor-ipmi-channel-inventory-native"
 
 # The phosphor-host-ipmid application is data-driven and requires an input
+# yaml of entity association record metadata.
+# This virtual is a native recipe that provides that mapping by installing
+# configuration files in the format and native sysroot location expected by
+# the phosphor-host-ipmid build process in the native sysroot.
+PREFERRED_PROVIDER_virtual/phosphor-ipmi-entity-config ?= "phosphor-ipmi-entity-inventory-native"
+
+# The phosphor-host-ipmid application is data-driven and requires an input
 # mapping of inventory object path to the sensor number and sensor metadata.
 # This virtual is a native recipe that provides that mapping by installing
 # configuration files in the format and native sysroot location expected by
diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory-native.bb
new file mode 100644
index 0000000..acc693e
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory-native.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Sample entity configuration for phosphor-host-ipmid"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit native
+inherit phosphor-ipmi-host
+
+PROVIDES += "virtual/phosphor-ipmi-entity-config"
+
+SRC_URI += "file://entity.yaml"
+
+S = "${WORKDIR}"
+
+do_install() {
+        # This recipe is supposed to create an output yaml file with
+        # a sample output file.
+
+        DEST=${D}${sensor_datadir}
+        install -d ${DEST}
+        install entity.yaml ${DEST}/entity.yaml
+}
diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory/entity.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory/entity.yaml
new file mode 100644
index 0000000..f41c2fd
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory/entity.yaml
@@ -0,0 +1,13 @@
+0x01:
+  containerEntityId: 0x1E
+  containerEntityInstance: 0x1
+  isList: "true"
+  isLinked: "false"
+  entityId1: 0x03
+  entityInstance1: 0x1
+  entityId2: 0x04
+  entityInstance2: 0x1
+  entityId3: 0x00
+  entityInstance3: 0x00
+  entityId4: 0x00
+  entityInstance4: 0x00
diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb
index 45dd98b..574d03b 100644
--- a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb
+++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb
@@ -34,6 +34,7 @@
 DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
 DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
 DEPENDS += "virtual/phosphor-ipmi-channel-config"
+DEPENDS += "virtual/phosphor-ipmi-entity-config"
 DEPENDS += "boost"
 DEPENDS += "sdeventplus"
 
@@ -77,6 +78,7 @@
         INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
         FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
         CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \
+        ENTITY_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/entity.yaml \
         POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\
         "