summaryrefslogtreecommitdiffstats
path: root/meta-openpower/common/recipes-phosphor/vpd
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openpower/common/recipes-phosphor/vpd')
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb22
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory2
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb28
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb22
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml6
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb29
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml11
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb19
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml15
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb47
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc5
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules1
-rw-r--r--meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service12
13 files changed, 219 insertions, 0 deletions
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb
new file mode 100644
index 000000000..8f9bd050b
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Inventory config for openpower-vpd-parser"
+PR = "r1"
+
+inherit native
+inherit obmc-phosphor-license
+inherit openpower-fru-vpd
+
+SRC_URI += "file://inventory"
+
+PROVIDES += "virtual/openpower-fru-inventory"
+
+S = "${WORKDIR}"
+
+do_install() {
+ # This recipe is supposed to create a systemd environment file
+ # with values for FRU types and paths. This example recipe
+ # uses a pre-defined file ($PN/inventory).
+
+ DEST=${D}${inventory_datadir_native}
+ install -d ${DEST}
+ install inventory ${DEST}
+}
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory
new file mode 100644
index 000000000..1f6a5e349
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory
@@ -0,0 +1,2 @@
+FRUS=BMC
+PATHS=/system/chassis/bmc
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb
new file mode 100644
index 000000000..6eb76ac4e
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Inventory config for openpower-vpd-parser"
+PR = "r1"
+
+inherit native
+inherit obmc-phosphor-license
+inherit openpower-fru-vpd
+inherit mrw-xml
+
+DEPENDS += " \
+ mrw-native \
+ mrw-perl-tools-native \
+ virtual/openpower-fru-vpd-layout \
+ "
+
+PROVIDES += "virtual/openpower-fru-inventory"
+
+S = "${WORKDIR}"
+
+do_install() {
+ DEST=${D}${inventory_datadir_native}
+ install -d ${DEST}
+
+ ${bindir}/perl-native/perl \
+ ${bindir}/gen_openpower_fru.pl \
+ -m ${mrw_datadir}/${MRW_XML} \
+ -c ${vpdlayout_datadir}/layout.yaml \
+ -o ${DEST}/inventory
+}
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb
new file mode 100644
index 000000000..7ed83b3a4
--- /dev/null
+++ b/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}/out.yaml
+}
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml
new file mode 100644
index 000000000..6ec9b0c35
--- /dev/null
+++ b/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-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb
new file mode 100644
index 000000000..2dc5820e3
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb
@@ -0,0 +1,29 @@
+SUMMARY = "FRU properties config for openpower-vpd-parser"
+PR = "r1"
+
+inherit native
+inherit obmc-phosphor-license
+inherit openpower-fru-vpd
+inherit mrw-xml
+
+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 ${mrw_datadir}/${MRW_XML} \
+ -c config.yaml \
+ -o ${DEST}/out.yaml
+}
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml
new file mode 100644
index 000000000..7a9f34ec5
--- /dev/null
+++ b/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-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb
new file mode 100644
index 000000000..de0cc649f
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "VPD layout for openpower-fru-vpd"
+PR = "r1"
+
+inherit native
+inherit openpower-fru-vpd
+inherit obmc-phosphor-license
+
+SRC_URI += "file://layout.yaml"
+
+PROVIDES += "virtual/openpower-fru-vpd-layout"
+
+S = "${WORKDIR}"
+
+do_install() {
+ DEST=${D}${vpdlayout_datadir}
+
+ install -d ${DEST}
+ install layout.yaml ${DEST}
+}
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml
new file mode 100644
index 000000000..9aa746232
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml
@@ -0,0 +1,15 @@
+BMC:
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ OPFR,VP: PartNumber
+ OPFR,VS: SerialNumber
+ OPFR,VN: Manufacturer
+ xyz.openbmc_project.Inventory.Item:
+ VINI,DR: PrettyName
+ xyz.openbmc_project.Common.UUID:
+ OPFR,UD: UUID
+ xyz.openbmc_project.Inventory.Item.Bmc:
+ETHERNET:
+ xyz.openbmc_project.Inventory.Item.NetworkInterface:
+ VINI,B1: MACAddress
+ OPFR,B1: MACAddress
+ xyz.openbmc_project.Inventory.Item.Ethernet:
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb
new file mode 100644
index 000000000..4d7114a73
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Parser for OpenPOWER-format FRU VPD"
+DESCRIPTION = "Parse OpenPOWER-format FRU VPD and update inventory"
+PR = "r1"
+
+inherit autotools pkgconfig
+inherit openpower-fru-vpd
+inherit pythonnative
+inherit obmc-phosphor-systemd
+
+require ${PN}.inc
+
+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 \
+ python-pyyaml-native \
+ autoconf-archive-native \
+ "
+
+RDEPENDS_${PN} += " \
+ sdbusplus \
+ phosphor-logging \
+ "
+
+SYSTEMD_SERVICE_${PN} += "op-vpd-parser.service"
+
+S = "${WORKDIR}/git"
+
+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}
+ DEST=${D}${inventory_envdir}
+ install -d ${DEST}
+ install ${SRC}/inventory ${DEST}
+
+ install -d ${D}/${base_libdir}/udev/rules.d/
+ install ${WORKDIR}/70-op-vpd.rules ${D}/${base_libdir}/udev/rules.d/
+}
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc
new file mode 100644
index 000000000..db1b736d6
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc
@@ -0,0 +1,5 @@
+HOMEPAGE = "https://github.com/openbmc/openpower-vpd-parser"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+SRC_URI += "git://github.com/openbmc/openpower-vpd-parser"
+SRCREV = "0097cced1f5633d14e3304fbcc6279e7026c3abf"
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules
new file mode 100644
index 000000000..4b86b9186
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="i2c", ENV{OF_NAME}=="eeprom", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="op-vpd-parser"
diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service
new file mode 100644
index 000000000..6eadebf8d
--- /dev/null
+++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Read OpenPOWER-format VPD from EEPROM
+ConditionFileNotEmpty={envfiledir}/obmc/inventory
+Wants=mapper-wait@-xyz-openbmc_project-inventory.service
+After=mapper-wait@-xyz-openbmc_project-inventory.service
+
+[Service]
+Restart=no
+Type=oneshot
+EnvironmentFile={envfiledir}/obmc/inventory
+ExecStart=/usr/bin/env openpower-read-vpd --vpd $EEPROM --fru $FRUS --object $PATHS
+SyslogIdentifier=openpower-read-vpd
OpenPOWER on IntegriCloud