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)
Change-Id: Ib78a1e2798b49434479b5459ca9bc96ccfdb66ae
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>
diff --git a/conf/distro/include/phosphor-defaults.inc b/conf/distro/include/phosphor-defaults.inc
index bac3ad1..b1ccbcd 100644
--- a/conf/distro/include/phosphor-defaults.inc
+++ b/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/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory-native.bb b/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory-native.bb
new file mode 100644
index 0000000..acc693e
--- /dev/null
+++ b/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/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory/entity.yaml b/recipes-phosphor/ipmi/phosphor-ipmi-entity-inventory/entity.yaml
new file mode 100644
index 0000000..f41c2fd
--- /dev/null
+++ b/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/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb b/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb
index 45dd98b..574d03b 100644
--- a/recipes-phosphor/ipmi/phosphor-ipmi-host_git.bb
+++ b/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\
"