summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-06-08 11:17:36 +0300
committerPatrick Williams <patrick@stwcx.xyz>2017-07-05 17:43:31 +0300
commit7b823189e656c67934a9ae32a13d458d0cc9b56a (patch)
tree73646bc2e6f9346bcc929a649f794e96c7615e02
parent9afc5ee005011d7050e7c2cdd646fb1067770a6b (diff)
downloadopenbmc-7b823189e656c67934a9ae32a13d458d0cc9b56a.tar.xz
Add native recipe to generate inventory map from MRW
Resolves openbmc/openbmc#1559 Change-Id: I3c663693df78cdf8daac83d49ca35982be27165a Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
-rw-r--r--meta-phosphor/classes/phosphor-ipmi-host.bbclass2
-rw-r--r--meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb17
-rw-r--r--meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb24
-rw-r--r--meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb2
-rw-r--r--meta-phosphor/conf/distro/include/phosphor-defaults.inc6
5 files changed, 51 insertions, 0 deletions
diff --git a/meta-phosphor/classes/phosphor-ipmi-host.bbclass b/meta-phosphor/classes/phosphor-ipmi-host.bbclass
index 285702965..97257823d 100644
--- a/meta-phosphor/classes/phosphor-ipmi-host.bbclass
+++ b/meta-phosphor/classes/phosphor-ipmi-host.bbclass
@@ -1 +1,3 @@
sensor_datadir="${datadir}/phosphor-ipmi-host/sensor"
+hostfw_datadir="${datadir}/phosphor-ipmi-fru/hostfw"
+config_datadir="${datadir}/phosphor-ipmi-host/config"
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb
new file mode 100644
index 000000000..25fa0f16e
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Sample inventory map for phosphor-ipmi-host"
+PR = "r1"
+
+inherit native
+inherit phosphor-ipmi-host
+
+require phosphor-ipmi-host.inc
+
+PROVIDES += "virtual/phosphor-ipmi-fru-read-inventory"
+
+S = "${WORKDIR}/git"
+
+do_install() {
+ DEST=${D}${config_datadir}
+ install -d ${DEST}
+ install scripts/example.yaml ${DEST}/config.yaml
+}
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb
new file mode 100644
index 000000000..6393f953a
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Generate inventory map for phosphor-ipmi-host from a MRW."
+PR = "r1"
+
+inherit native
+inherit phosphor-ipmi-host
+
+require phosphor-ipmi-host.inc
+
+DEPENDS += "mrw-native mrw-perl-tools-native"
+
+DEPENDS += "virtual/phosphor-ipmi-fru-hostfw-config"
+PROVIDES += "virtual/phosphor-ipmi-fru-read-inventory"
+
+do_install() {
+
+ DEST=${D}${config_datadir}
+ install -d ${DEST}
+
+ ${bindir}/perl-native/perl \
+ ${bindir}/gen_ipmi_fru.pl \
+ -i ${datadir}/obmc-mrw/${MACHINE}.xml \
+ -m ${hostfw_datadir}/config.yaml \
+ -o ${DEST}/config.yaml
+}
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
index 91658f6bd..f2fa39e44 100644
--- a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
@@ -21,6 +21,7 @@ DEPENDS += "sdbusplus"
DEPENDS += "phosphor-dbus-interfaces"
DEPENDS += "obmc-targets"
DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
+DEPENDS += "virtual/phosphor-ipmi-fru-read-inventory"
RDEPENDS_${PN}-dev += "phosphor-logging"
RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
@@ -46,6 +47,7 @@ EXTRA_OECONF = " \
WHITELIST_CONF="${WHITELIST_CONF}" \
SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
+ FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/config.yaml \
"
S = "${WORKDIR}/git"
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index b53eb136a..e8462ca64 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -138,6 +138,7 @@ VIRTUAL-RUNTIME_obmc-settings-mgr ?= "phosphor-settings-manager"
# the phosphor-ipmi-fru build process.
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "phosphor-ipmi-fru-hostfw-config-example-native"
+
# The phosphor-ipmi-fru application is data-driven and requires an input
# mapping of IPMI inventory metadata to DBus objects interfaces and properties.
# This virtual is a native recipe that provides that mapping by installing
@@ -145,9 +146,14 @@ PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "phosphor-ipmi-fru
# the phosphor-ipmi-fru build process in the native sysroot.
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory ?= \
"${@cf_enabled(d, 'obmc-mrw', 'phosphor-ipmi-fru-inventory-mrw-native', 'phosphor-ipmi-fru-inventory-example-native')}"
+
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-properties ?= \
"${@cf_enabled(d, 'obmc-mrw', 'phosphor-ipmi-fru-properties-mrw-native', 'phosphor-ipmi-fru-properties-native')}"
+
+PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-read-inventory ?= \
+ "${@cf_enabled(d, 'obmc-mrw', 'phosphor-ipmi-fru-read-inventory-mrw-native', 'phosphor-ipmi-fru-read-inventory-example-native')}"
+
# The phosphor-led-manager application is data-driven and requires an input
# yaml of LED group and members.
# This virtual is a native recipe that provides that mapping by installing