From 7b823189e656c67934a9ae32a13d458d0cc9b56a Mon Sep 17 00:00:00 2001 From: Marri Devender Rao Date: Thu, 8 Jun 2017 03:17:36 -0500 Subject: Add native recipe to generate inventory map from MRW Resolves openbmc/openbmc#1559 Change-Id: I3c663693df78cdf8daac83d49ca35982be27165a Signed-off-by: Marri Devender Rao --- meta-phosphor/classes/phosphor-ipmi-host.bbclass | 2 ++ ...sphor-ipmi-fru-read-inventory-example-native.bb | 17 +++++++++++++++ .../phosphor-ipmi-fru-read-inventory-mrw-native.bb | 24 ++++++++++++++++++++++ .../recipes-phosphor/ipmi/phosphor-ipmi-host.bb | 2 ++ .../conf/distro/include/phosphor-defaults.inc | 6 ++++++ 5 files changed, 51 insertions(+) create mode 100644 meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb create mode 100644 meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb (limited to 'meta-phosphor') 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 -- cgit v1.2.3