blob: ccb69892b89c567d34e3bd4d1cbc640aa8632b0b [file] [log] [blame]
Brad Bishop2c5ba172017-04-22 16:26:22 -04001SUMMARY = "Phosphor Fan"
2DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \
3control applications."
4PR = "r1"
Patrick Ventureeb433702018-10-21 08:25:11 -07005PV = "1.0+git${SRCPV}"
Brad Bishop2c5ba172017-04-22 16:26:22 -04006
7require ${PN}.inc
8
9inherit autotools pkgconfig pythonnative
10inherit obmc-phosphor-systemd
11inherit phosphor-fan
12
13S = "${WORKDIR}/git"
14
15# Common build dependencies
16DEPENDS += "autoconf-archive-native"
17DEPENDS += "python-pyyaml-native"
18DEPENDS += "python-mako-native"
19DEPENDS += "sdbusplus"
Brad Bishopf06d3b62018-01-26 21:48:20 -050020DEPENDS += "sdbusplus-native"
William A. Kennington III581d3c22018-10-19 18:24:31 -070021DEPENDS += "sdeventplus"
William A. Kennington III8711f982018-10-29 16:32:26 -070022DEPENDS += "gpioplus"
Brad Bishop2c5ba172017-04-22 16:26:22 -040023DEPENDS += "phosphor-logging"
Brad Bishop0eaba742017-07-30 21:25:23 -040024DEPENDS += "libevdev"
Matthew Barth0b94fef2020-01-14 15:38:05 -060025DEPENDS += "nlohmann-json"
Brad Bishop2c5ba172017-04-22 16:26:22 -040026
27# Package configuration
28FAN_PACKAGES = " \
29 ${PN}-presence-tach \
30 ${PN}-control \
Matt Spinler39652c82017-05-01 14:29:20 -050031 ${PN}-monitor \
Brad Bishop2c5ba172017-04-22 16:26:22 -040032"
Brandon Wyman0f786282017-04-28 18:26:45 -050033
Brad Bishop1c5aa362018-04-11 11:41:50 -040034ALLOW_EMPTY_${PN} = "1"
35PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
Brandon Wymana7b44402017-06-09 17:50:42 -050036PACKAGECONFIG ?= "presence control monitor"
Brad Bishop2c5ba172017-04-22 16:26:22 -040037SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040038
39# --------------------------------------
40# ${PN}-presence-tach specific configuration
41PACKAGECONFIG[presence] = " \
42 --enable-presence \
Brad Bishopf3b437c2019-05-13 23:12:55 -040043 PRESENCE_CONFIG=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \
Brad Bishop2c5ba172017-04-22 16:26:22 -040044 --disable-presence, \
45 virtual/phosphor-fan-presence-config \
46 , \
47"
Brad Bishop2c5ba172017-04-22 16:26:22 -040048
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050049# Needed to install into the obmc-chassis-poweron target
50TMPL_TACH = "phosphor-fan-presence-tach@.service"
51INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -050052POWERON_TGT = "obmc-chassis-poweron@{0}.target"
53FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040054
Andrew Geisslerfdb5baf2019-03-29 14:31:49 +000055FILES_${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050056SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}"
57SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040058
59# --------------------------------------
60# ${PN}-control specific configuration
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050061PACKAGECONFIG[control] = "--enable-control \
Brad Bishopf3b437c2019-05-13 23:12:55 -040062 FAN_DEF_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/fans.yaml \
63 FAN_ZONE_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zones.yaml \
64 ZONE_EVENTS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/events.yaml \
65 ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml \
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050066 FAN_ZONE_OUTPUT_DIR=${S}/control, \
67 --disable-control, \
68 virtual/phosphor-fan-control-fan-config \
Brad Bishopf3b437c2019-05-13 23:12:55 -040069 phosphor-fan-control-zone-config \
70 phosphor-fan-control-events-config \
71 phosphor-fan-control-zone-conditions-config \
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050072 , \
73"
74
Matt Spinler29feaa32017-05-16 10:49:57 -050075FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
76
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050077TMPL_CONTROL = "phosphor-fan-control@.service"
78INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -050079FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
80
81TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
82INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
Matthew Barthbc6a7502017-10-24 14:04:46 -050083FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050084
Andrew Geisslerfdb5baf2019-03-29 14:31:49 +000085FILES_${PN}-control = "${bindir}/phosphor-fan-control"
Matt Spinler29feaa32017-05-16 10:49:57 -050086SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050087SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
Matt Spinler29feaa32017-05-16 10:49:57 -050088SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040089
90# --------------------------------------
Matt Spinler39652c82017-05-01 14:29:20 -050091# ${PN}-monitor specific configuration
92PACKAGECONFIG[monitor] = "--enable-monitor \
Brad Bishopf3b437c2019-05-13 23:12:55 -040093 FAN_MONITOR_YAML_FILE=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml \
Matt Spinler39652c82017-05-01 14:29:20 -050094 FAN_MONITOR_OUTPUT_DIR=${S}/monitor, \
95 --disable-monitor, \
Brad Bishopf3b437c2019-05-13 23:12:55 -040096 phosphor-fan-monitor-config \
Matt Spinler39652c82017-05-01 14:29:20 -050097 , \
98"
99
Matt Spinler39652c82017-05-01 14:29:20 -0500100TMPL_MONITOR = "phosphor-fan-monitor@.service"
101INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -0500102FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
Matt Spinler39652c82017-05-01 14:29:20 -0500103
Matthew Barth600d4962017-08-23 13:18:01 -0500104TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
105INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
Matthew Barthbc6a7502017-10-24 14:04:46 -0500106FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
Matthew Barth600d4962017-08-23 13:18:01 -0500107
Andrew Geisslerfdb5baf2019-03-29 14:31:49 +0000108FILES_${PN}-monitor = "${bindir}/phosphor-fan-monitor"
Matthew Barth600d4962017-08-23 13:18:01 -0500109SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}"
Matt Spinler39652c82017-05-01 14:29:20 -0500110SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth600d4962017-08-23 13:18:01 -0500111SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wyman0f786282017-04-28 18:26:45 -0500112
113# --------------------------------------
114# phosphor-cooling-type specific configuration
Brad Bishop0eaba742017-07-30 21:25:23 -0400115PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,,"