From f7a1a7854bfb13d8d7b449de348c4d3a885fcb59 Mon Sep 17 00:00:00 2001 From: Deepak Kodihalli Date: Mon, 20 Feb 2017 00:21:12 -0600 Subject: Add virtual/openpower-fru-properties This virtual provides an output file in YAML format, which has property:value pairs for FRUs of interest. Add a native recipe that extracts property values from the MRW. Set this as the default for OpenPOWER systems. Change-Id: Ib56d253aaceeb84bdb40381147915b3cfc80942a Signed-off-by: Deepak Kodihalli --- .../classes/openpower-fru-vpd.bbclass | 1 + .../vpd/openpower-fru-properties-example-native.bb | 22 +++++++++++++++++ .../openpower-fru-properties-example/example.yaml | 6 +++++ .../vpd/openpower-fru-properties-mrw-native.bb | 28 ++++++++++++++++++++++ .../vpd/openpower-fru-properties-mrw/config.yaml | 11 +++++++++ .../recipes-phosphor/vpd/openpower-fru-vpd.bb | 6 ++++- .../conf/machine/include/openpower.inc | 2 ++ 7 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb create mode 100644 meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml create mode 100644 meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb create mode 100644 meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml (limited to 'meta-openbmc-machines') diff --git a/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass b/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass index e86a2196f..a97774e35 100644 --- a/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass +++ b/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass @@ -2,3 +2,4 @@ vpdlayout_datadir="${datadir}/openpower-fru-vpd/vpdlayout" inventory_datadir_name="/openpower-fru-inventory/inventory" inventory_datadir_native="${datadir}${inventory_datadir_name}" inventory_envdir="${envfiledir}/obmc" +properties_datadir="${datadir}/openpower-fru-vpd/properties" diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb new file mode 100644 index 000000000..aa79432d1 --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb @@ -0,0 +1,22 @@ +SUMMARY = "FRU properties config for openpower-vpd-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-fru-vpd + +SRC_URI += "file://example.yaml" + +PROVIDES += "virtual/openpower-fru-properties" + +S = "${WORKDIR}" + +do_install() { + # This recipe is supposed to create an output yaml file with + # FRU property values extracted from the MRW. This example recipe + # provides a sample output file. + + DEST=${D}${properties_datadir} + install -d ${DEST} + install example.yaml ${DEST} +} diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml new file mode 100644 index 000000000..6ec9b0c35 --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml @@ -0,0 +1,6 @@ +/system/chassis/motherboard/boxelder/bmc: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' +/system/chassis/motherboard/boxelder/bmc/ethernet: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb new file mode 100644 index 000000000..71194848d --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb @@ -0,0 +1,28 @@ +SUMMARY = "FRU properties config for openpower-vpd-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-fru-vpd + +SRC_URI += "file://config.yaml" + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/openpower-fru-properties" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${properties_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_fru_properties.pl \ + -m ${datadir}/obmc-mrw/${MACHINE}.xml \ + -c config.yaml \ + -o ${DEST}/out.yaml +} diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml new file mode 100644 index 000000000..7a9f34ec5 --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml @@ -0,0 +1,11 @@ +BMC: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' + +ETHERNET: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb index 1efe2ea21..4d7114a73 100644 --- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb @@ -14,6 +14,7 @@ SRC_URI += "file://70-op-vpd.rules" DEPENDS += " \ virtual/openpower-fru-vpd-layout \ virtual/openpower-fru-inventory \ + virtual/openpower-fru-properties \ sdbusplus \ phosphor-logging \ python-mako-native \ @@ -30,7 +31,10 @@ SYSTEMD_SERVICE_${PN} += "op-vpd-parser.service" S = "${WORKDIR}/git" -EXTRA_OECONF = "FRU_YAML=${STAGING_DIR_NATIVE}${vpdlayout_datadir}/layout.yaml" +EXTRA_OECONF = " \ + FRU_YAML=${STAGING_DIR_NATIVE}${vpdlayout_datadir}/layout.yaml \ + PROP_YAML=${STAGING_DIR_NATIVE}${properties_datadir}/out.yaml \ + " do_install_append() { SRC=${STAGING_DATADIR_NATIVE}${inventory_datadir_name} diff --git a/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc b/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc index ed87ec807..74b3268cd 100644 --- a/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc +++ b/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc @@ -23,3 +23,5 @@ PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "hostboot-inventor PREFERRED_PROVIDER_virtual/openpower-fru-vpd-layout ?= "openpower-fru-vpd-layout-native" PREFERRED_PROVIDER_virtual/openpower-fru-inventory ?= \ "${@cf_enabled(d, 'obmc-mrw', 'openpower-fru-inventory-mrw-native', 'openpower-fru-inventory-example-native')}" +PREFERRED_PROVIDER_virtual/openpower-fru-properties ?= \ + "${@cf_enabled(d, 'obmc-mrw', 'openpower-fru-properties-mrw-native', 'openpower-fru-properties-example-native')}" -- cgit v1.2.1