diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-31 13:25:51 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-09-06 14:44:12 +0300 |
commit | ff075f6ee795a590b244d70a90cc312ba1f2d83d (patch) | |
tree | a617790bdbfdeef960665ba0242e1f0c93e5301a /meta-phosphor/recipes-phosphor/fans | |
parent | 3e4da38c127bb7e7641adc2fc41f4c33744cb918 (diff) | |
download | openbmc-ff075f6ee795a590b244d70a90cc312ba1f2d83d.tar.xz |
meta-phosphor: Move layer content from common/
Adopt a more conventional directory hierarchy. meta-phosphor is still
a _long_ way from suitable for hosting on yoctoproject.org but things
like this don't help.
(From meta-phosphor rev: 471cfcefa74b8c7ceb704cb670e6d915cf27c63b)
Change-Id: I3f106b2f6cdc6cec734be28a6090800546f362eb
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/fans')
29 files changed, 510 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/fans/files/Makefile b/meta-phosphor/recipes-phosphor/fans/files/Makefile new file mode 100644 index 000000000..10e3fa2ae --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/files/Makefile @@ -0,0 +1,15 @@ +EXE = obmc-phosphor-fand +OBJS = $(EXE).o +DEPPKGS = gio-unix-2.0 glib-2.0 +CC ?= $(CROSS_COMPILE)gcc +INCLUDES += $(shell pkg-config --cflags $(DEPPKGS)) +LIBS += $(shell pkg-config --libs $(DEPPKGS)) + +%.o : %.c + $(CC) -c $^ $(CFLAGS) $(INCLUDES) -o $@ +$(EXE): $(OBJS) + $(CC) $^ $(LDFLAGS) $(LDFLAGS) -o $@ +clean: + rm -f $(OBJS) $(EXE) *.o *.d +distclean: clean + rm -f *.c~ *.h~ *.sh~ Makefile~ config.mk~ diff --git a/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.c b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.c new file mode 100644 index 000000000..558ba10bc --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.c @@ -0,0 +1,29 @@ +/* Contributors Listed Below - COPYRIGHT 2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ + +#include <stdio.h> +#include <stdlib.h> +#include <gio/gio.h> + +int main(int argc, char *argv[]) +{ + printf("obmc-phosphor-fand starting...\n"); + + while(1) + sleep(5); + + exit(EXIT_SUCCESS); +} diff --git a/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.service b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.service new file mode 100644 index 000000000..958474989 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Fan Controller + +[Service] +Restart=always +ExecStart=/usr/bin/env obmc-phosphor-fand +SyslogIdentifier=obmc-phosphor-fand + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan.bb b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan.bb new file mode 100644 index 000000000..60bc87616 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan.bb @@ -0,0 +1,13 @@ +SUMMARY = "OpenBMC fan control" +DESCRIPTION = "OpenBMC fan control." +PR = "r1" + +inherit skeleton-sdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +RDEPENDS_${PN} += "libsystemd" +SKELETON_DIR = "fanctl" + +DBUS_SERVICE_${PN} += "org.openbmc.control.Fans.service" +SYSTEMD_SERVICE_${PN} += "obmc-max-fans.service" diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/obmc-max-fans.service b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/obmc-max-fans.service new file mode 100644 index 000000000..f062fc9c8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/obmc-max-fans.service @@ -0,0 +1,11 @@ +[Unit] +Description=Set Fans to Maximum +Wants=mapper-wait@-org-openbmc-control-fans.service +After=mapper-wait@-org-openbmc-control-fans.service +After=obmc-fan-control.target + +[Service] +Type=oneshot +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/fans` /org/openbmc/control/fans org.openbmc.control.Fans setMax" +SyslogIdentifier=obmc-max-fans diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/org.openbmc.control.Fans.service b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/org.openbmc.control.Fans.service new file mode 100644 index 000000000..ec6391d5c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/org.openbmc.control.Fans.service @@ -0,0 +1,17 @@ +[Unit] +Description=Phosphor Fan Control +Wants=obmc-fans-ready.target +After=obmc-fans-ready.target +Wants=obmc-fan-control.target +Before=obmc-fan-control.target + +[Service] +Restart=always +ExecStart=/usr/bin/env fan_control.exe -f 6 +SyslogIdentifier=fan_control.exe +Type=dbus +BusName={BUSNAME} +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-phosphor-fand.bb b/meta-phosphor/recipes-phosphor/fans/obmc-phosphor-fand.bb new file mode 100644 index 000000000..6faab00a2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-phosphor-fand.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor OpenBMC Fan Management." +DESCRIPTION = "Phosphor OpenBMC fan management reference implementation." +PR = "r1" + +inherit pkgconfig +inherit obmc-phosphor-sdbus-service +inherit obmc-phosphor-c-daemon + +PROVIDES += "virtual/obmc-fan-mgmt" +RPROVIDES_${PN} += "virtual-obmc-fan-mgmt" + +S = "${WORKDIR}" +SRC_URI += "file://Makefile \ + file://obmc-phosphor-fand.c \ + " diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bb new file mode 100644 index 000000000..740b194ad --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor zone events definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://events.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D events.yaml ${DEST}/events.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config/events.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config/events.yaml new file mode 100644 index 000000000..b89d1dca7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config/events.yaml @@ -0,0 +1,2 @@ +#Default zone events definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw-native.bb new file mode 100644 index 000000000..7ae05ce80 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw-native.bb @@ -0,0 +1,28 @@ +SUMMARY = "Generate fan control YAML from the MRW" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan +inherit mrw-xml + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-fan-control-fan-config" + +S = "${WORKDIR}" + +do_compile() { + ${bindir}/perl-native/perl \ + ${bindir}/gen_fan_zone_yaml.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -o ${S}/fans.yaml +} + +do_install() { + DEST=${D}${control_datadir} + install -D ${S}/fans.yaml ${DEST}/fans.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bb new file mode 100644 index 000000000..76b0985ca --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "Phosphor fan definition example data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +PROVIDES += "virtual/phosphor-fan-control-fan-config" + +SRC_URI += "file://fans.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D fans.yaml ${DEST}/fans.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config/fans.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config/fans.yaml new file mode 100644 index 000000000..8a6c271f2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config/fans.yaml @@ -0,0 +1,2 @@ +#Default fan definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bb new file mode 100644 index 000000000..065efa539 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor zone conditions definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://zone_conditions.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D zone_conditions.yaml ${DEST}/zone_conditions.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config/zone_conditions.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config/zone_conditions.yaml new file mode 100644 index 000000000..13406207c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config/zone_conditions.yaml @@ -0,0 +1,2 @@ +#Default zone conditions definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bb new file mode 100644 index 000000000..4d8759e47 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor fan zone definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://zones.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D zones.yaml ${DEST}/zones.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config/zones.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config/zones.yaml new file mode 100644 index 000000000..d25803ce6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config/zones.yaml @@ -0,0 +1,2 @@ +#Default fan zone definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bb new file mode 100644 index 000000000..02420e43e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor fan monitor definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://monitor.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${monitor_datadir} + install -D monitor.yaml ${DEST}/monitor.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config/monitor.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config/monitor.yaml new file mode 100644 index 000000000..ce60a2202 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config/monitor.yaml @@ -0,0 +1,2 @@ +#Default fan monitor definition YAML - empty. +#For format, see documentation in fan monitor code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config-native.bb new file mode 100644 index 000000000..0eb38737c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config-native.bb @@ -0,0 +1,22 @@ +# Provides the config file for the phosphor-fan-presence application. +# The default config file is empty. To provide a real one, +# append this recipe in a layer, add: +# FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +# and provide a config file. + +SUMMARY = "Config file for phosphor-fan-presence" +PR = "r1" + +inherit native +inherit phosphor-fan +inherit obmc-phosphor-license + +PROVIDES += "virtual/phosphor-fan-presence-config" + +SRC_URI += "file://config.yaml" + +S = "${WORKDIR}" + +do_install() { + install -D config.yaml ${D}${presence_datadir}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config/config.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config/config.yaml new file mode 100644 index 000000000..15a10f409 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config/config.yaml @@ -0,0 +1,3 @@ +# This file is a stub. Consult +# https://github.com/openbmc/phosphor-fan-presence +# for file format description and examples. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb new file mode 100644 index 000000000..47dc2a4a1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb @@ -0,0 +1,26 @@ +SUMMARY = "Generate fan presence YAML from the MRW" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan +inherit mrw-xml + +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 ${mrw_datadir}/${MRW_XML} \ + -o ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.bb new file mode 100644 index 000000000..9e4db307a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.bb @@ -0,0 +1,116 @@ +SUMMARY = "Phosphor Fan" +DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \ +control applications." +PR = "r1" + +require ${PN}.inc + +inherit autotools pkgconfig pythonnative +inherit obmc-phosphor-systemd +inherit phosphor-fan + +S = "${WORKDIR}/git" + +# Common build dependencies +DEPENDS += "autoconf-archive-native" +DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" +DEPENDS += "sdbusplus" +DEPENDS += "sdbusplus-native" +DEPENDS += "phosphor-logging" +DEPENDS += "libevdev" + +# Package configuration +FAN_PACKAGES = " \ + ${PN}-presence-tach \ + ${PN}-control \ + ${PN}-monitor \ +" + +ALLOW_EMPTY_${PN} = "1" +PACKAGE_BEFORE_PN += "${FAN_PACKAGES}" +PACKAGECONFIG ?= "presence control monitor" +SYSTEMD_PACKAGES = "${FAN_PACKAGES}" + +# -------------------------------------- +# ${PN}-presence-tach specific configuration +PACKAGECONFIG[presence] = " \ + --enable-presence \ + PRESENCE_CONFIG=${STAGING_DIR_NATIVE}${presence_datadir}/config.yaml, \ + --disable-presence, \ + virtual/phosphor-fan-presence-config \ + , \ +" +RDEPENDS_${PN}-presence-tach += "sdbusplus" + +# Needed to install into the obmc-chassis-poweron target +TMPL_TACH = "phosphor-fan-presence-tach@.service" +INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service" +POWERON_TGT = "obmc-chassis-poweron@{0}.target" +FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}" + +FILES_${PN}-presence-tach = "${sbindir}/phosphor-fan-presence-tach" +SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}" +SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}" + +# -------------------------------------- +# ${PN}-control specific configuration +PACKAGECONFIG[control] = "--enable-control \ + FAN_DEF_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/fans.yaml \ + FAN_ZONE_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zones.yaml \ + ZONE_EVENTS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/events.yaml \ + ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zone_conditions.yaml \ + FAN_ZONE_OUTPUT_DIR=${S}/control, \ + --disable-control, \ + virtual/phosphor-fan-control-fan-config \ + phosphor-fan-control-zone-config-native \ + phosphor-fan-control-events-config-native \ + phosphor-fan-control-zone-conditions-config-native \ + , \ +" + +RDEPENDS_${PN}-control += "sdbusplus" + +FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target" + +TMPL_CONTROL = "phosphor-fan-control@.service" +INSTFMT_CONTROL = "phosphor-fan-control@{0}.service" +FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}" + +TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service" +INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service" +FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}" + +FILES_${PN}-control = "${sbindir}/phosphor-fan-control" +SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}" +SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}" + +# -------------------------------------- +# ${PN}-monitor specific configuration +PACKAGECONFIG[monitor] = "--enable-monitor \ + FAN_MONITOR_YAML_FILE=${STAGING_DIR_NATIVE}${monitor_datadir}/monitor.yaml \ + FAN_MONITOR_OUTPUT_DIR=${S}/monitor, \ + --disable-monitor, \ + phosphor-fan-monitor-config-native \ + , \ +" + +RDEPENDS_${PN}-monitor += "sdbusplus" + +TMPL_MONITOR = "phosphor-fan-monitor@.service" +INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service" +FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" + +TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service" +INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service" +FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}" + +FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor" +SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}" +SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}" + +# -------------------------------------- +# phosphor-cooling-type specific configuration +PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,," diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan.inc b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.inc new file mode 100644 index 000000000..53b80bf2f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.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 = "ecd4bc7bf240b7d30ece98e74f7056b2cab1f38b" diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service new file mode 100644 index 000000000..96b40f666 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Fan Control Initialization +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-control --init +SyslogIdentifier=phosphor-fan-control + +[Install] +WantedBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service new file mode 100644 index 000000000..8c5903e08 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor Fan Control Daemon +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-control --control +SyslogIdentifier=phosphor-fan-control + +[Install] +RequiredBy=obmc-fan-control-ready@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service new file mode 100644 index 000000000..e8a6f699a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Fan Monitor Initialization +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-monitor --init +SyslogIdentifier=phosphor-fan-monitor + +[Install] +WantedBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service new file mode 100644 index 000000000..ddecfba3c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor Fan Monitor Daemon +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-monitor --monitor +SyslogIdentifier=phosphor-fan-monitor + +[Install] +RequiredBy=obmc-fan-control-ready@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-presence-tach@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-presence-tach@.service new file mode 100644 index 000000000..a324740c5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-presence-tach@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Fan Presence Tach Daemon +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-presence-tach +SyslogIdentifier=phosphor-fan-presence-tach + +[Install] +RequiredBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control.bb new file mode 100644 index 000000000..28ad04b28 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control.bb @@ -0,0 +1,52 @@ +HOMEPAGE = "github.com/openbmc/phosphor-pid-control" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +SUMMARY = "Phosphor PID Fan Control" +DESCRIPTION = "Fan Control" +PR = "r1" + +SRC_URI = "git://github.com/openbmc/phosphor-pid-control" +SRCREV = "e2ec0f618a9b3b6809a98516abe63d5d833e7fe7" +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit pythonnative + +inherit phosphor-pid-control +inherit obmc-phosphor-ipmiprovider-symlink + +# Each platform will need a service file that starts +# at an appropriate time per system. For instance, if +# your system relies on passive dbus for fans or other +# sensors then it may be prudent to wait for all of them. + +DEPENDS += "autoconf-archive-native" +DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-logging" +DEPENDS += "libevdev" +DEPENDS += "libconfig" + +# We depend on someone providing their system's configuration. +DEPENDS += "virtual/phosphor-fans-sensor-inventory" +# We depend on this to be built first so we can build our providers. +DEPENDS += "phosphor-ipmi-host" + +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" + +FILES_${PN} = "${sbindir}/swampd ${sbindir}/setsensor" + +# The following installs the OEM IPMI handler for the fan controls. +FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}" +FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" + +EXTRA_OECONF = "SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor-list.yaml \ + PID_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/pid-list.yaml \ + ZONE_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/zone-info.yaml" + +HOSTIPMI_PROVIDER_LIBRARY += "libmanualcmds.so" |