diff options
6 files changed, 64 insertions, 6 deletions
diff --git a/meta-phosphor/classes/phosphor-fan-presence.bbclass b/meta-phosphor/classes/phosphor-fan-presence.bbclass new file mode 100644 index 000000000..b59f1f567 --- /dev/null +++ b/meta-phosphor/classes/phosphor-fan-presence.bbclass @@ -0,0 +1 @@ +presence_datadir="${datadir}/phosphor-fan-presence" diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence-example-native.bb b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence-example-native.bb new file mode 100644 index 000000000..c97865ee2 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence-example-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "Phosphor Fan Presence Detection example data" +PR = "r1" + +require phosphor-fan-presence.inc + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan-presence + +PROVIDES += "virtual/phosphor-fan-presence-config" + +S = "${WORKDIR}/git" + +do_install() { + DEST=${D}${presence_datadir} + install -D ${S}/example/fan-detect.yaml ${DEST}/config.yaml +} diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb new file mode 100644 index 000000000..267fc9296 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb @@ -0,0 +1,25 @@ +SUMMARY = "Generate fan presence YAML from the MRW" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan-presence + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-fan-presence-config" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${presence_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_presence_yaml.pl \ + -i ${datadir}/obmc-mrw/${MACHINE}.xml \ + -o ${DEST}/config.yaml +} diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.bb b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.bb index ec17267f9..2d5b5b870 100644 --- a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.bb +++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.bb @@ -2,18 +2,20 @@ SUMMARY = "Phosphor Fan Presence" DESCRIPTION = "Phosphor fan presence provides a set of fan presence \ daemons to monitor fan presence changes by different methods of \ presence detection." -HOMEPAGE = "https://github.com/openbmc/phosphor-fan-presence" PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +require ${PN}.inc inherit autotools pkgconfig pythonnative inherit obmc-phosphor-systemd +inherit phosphor-fan-presence DEPENDS += "autoconf-archive-native" DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" DEPENDS += "sdbusplus" DEPENDS += "phosphor-logging" +DEPENDS += "virtual/phosphor-fan-presence-config" RDEPENDS_${PN} += "sdbusplus" FAN_PRESENCE_PACKAGES = " \ @@ -34,7 +36,7 @@ FILES_${PN}-tach = "${sbindir}/phosphor-fan-presence-tach" SYSTEMD_SERVICE_${PN}-tach += "${TMPL}" SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" -SRC_URI += "git://github.com/openbmc/phosphor-fan-presence" -SRCREV = "2b44a6c0b282cf50c563a175535c4c32f55a81dc" - S = "${WORKDIR}/git" + +EXTRA_OECONF = \ + "FAN_DETECT_YAML_FILE=${STAGING_DIR_NATIVE}${presence_datadir}/config.yaml" diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.inc b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.inc new file mode 100644 index 000000000..e251c83c0 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan-presence.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/phosphor-fan-presence" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-fan-presence" +SRCREV = "2b44a6c0b282cf50c563a175535c4c32f55a81dc" diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc index f78ea3328..06995baa7 100644 --- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc +++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc @@ -126,5 +126,13 @@ PREFERRED_PROVIDER_virtual/phosphor-ipmi-sensor-inventory ?= \ PREFERRED_PROVIDER_virtual/phosphor-logging-callouts ?= \ "${@cf_enabled(d, 'obmc-mrw', 'phosphor-logging-callouts-mrw-native', 'phosphor-logging-callouts-example-native')}" +# The phosphor-fan-presence application is data driven and requires an +# input YAML that maps fans to their tach sensors. +# This virtual is a native recipe that provides that mapping by installing +# configuration files in the format and native sysroot location expected by +# the phosphor-fan-presence build process in the native sysroot. +PREFERRED_PROVIDER_virtual/phosphor-fan-presence-config ?= \ + "${@cf_enabled(d, 'obmc-mrw', 'phosphor-fan-presence-mrw-native', 'phosphor-fan-presence-example-native')}" + OBMC_DBUS_PATH_ROOT ?= "/xyz/openbmc_project" OBMC_DBUS_IFACE_ROOT ?= "xyz.openbmc_project" |