diff options
3 files changed, 36 insertions, 1 deletions
diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe new file mode 100644 index 0000000000..6eb9643fc1 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe @@ -0,0 +1,22 @@ +#!/bin/bash + +read_mux_dev() { + for _ in {1..3}; do + if /usr/sbin/i2cget -f -y "$1" "$2" 2>/dev/null; then + return 0 + fi + done + return 1 +} + +probe_sitv_pttv_mux() { + if read_mux_dev 9 0x71; then + echo pca9546 0x71 > /sys/bus/i2c/devices/i2c-9/new_device + else + echo pca9546 0x71 > /sys/bus/i2c/devices/i2c-11/new_device + fi +} + +probe_sitv_pttv_mux + +exit 0 diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf new file mode 100644 index 0000000000..e3f79cee63 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf @@ -0,0 +1,3 @@ +[Service] +ExecStartPre=/usr/libexec/entity-manager/device-driver-probe + diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend index 6e89557dec..23e7ed4c3b 100644 --- a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend +++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend @@ -1,9 +1,19 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI:append = " \ +inherit obmc-phosphor-systemd systemd + +SRC_URI += "\ file://blacklist.json \ + file://device-driver-probe \ " +RDEPENDS:${PN}:append = " bash" + +SYSTEMD_OVERRIDE:${PN} += "xyz.openbmc_project.EntityManager.conf:xyz.openbmc_project.EntityManager.service.d/xyz.openbmc_project.EntityManager.conf" + do_install:append() { install -m 0644 -D ${WORKDIR}/blacklist.json ${D}${datadir}/${PN}/blacklist.json + + install -d ${D}${libexecdir}/${PN} + install -m 0755 ${WORKDIR}/device-driver-probe ${D}${libexecdir}/${PN}/ } |