blob: 0e12d44b9cc678e311185d557d7b8a36761108aa [file] [log] [blame]
Brad Bishopbd9931f2017-04-22 16:26:22 -04001SUMMARY = "Phosphor Fan"
2DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \
3control applications."
4PR = "r1"
Patrick Venture5def7e72018-10-21 08:25:11 -07005PV = "1.0+git${SRCPV}"
Brad Bishopbd9931f2017-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 Bishop04ff12c2018-01-26 21:48:20 -050020DEPENDS += "sdbusplus-native"
William A. Kennington IIIaa5d9452018-10-19 18:24:31 -070021DEPENDS += "sdeventplus"
William A. Kennington III3bb26b92018-10-29 16:32:26 -070022DEPENDS += "gpioplus"
Brad Bishopbd9931f2017-04-22 16:26:22 -040023DEPENDS += "phosphor-logging"
Brad Bishop4785fdf2017-07-30 21:25:23 -040024DEPENDS += "libevdev"
Matthew Barth61a59ad2020-01-14 15:38:05 -060025DEPENDS += "nlohmann-json"
Brad Bishopbd9931f2017-04-22 16:26:22 -040026
27# Package configuration
28FAN_PACKAGES = " \
29 ${PN}-presence-tach \
30 ${PN}-control \
Matt Spinlerdd7a0802017-05-01 14:29:20 -050031 ${PN}-monitor \
Brad Bishopbd9931f2017-04-22 16:26:22 -040032"
Brandon Wymanc50a8c42017-04-28 18:26:45 -050033
Brad Bishop93df99a2018-04-11 11:41:50 -040034ALLOW_EMPTY_${PN} = "1"
35PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
Brandon Wyman5b42b742017-06-09 17:50:42 -050036PACKAGECONFIG ?= "presence control monitor"
Brad Bishopbd9931f2017-04-22 16:26:22 -040037SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040038
39# --------------------------------------
40# ${PN}-presence-tach specific configuration
41PACKAGECONFIG[presence] = " \
42 --enable-presence \
Brad Bishopc8b67b32019-05-13 23:12:55 -040043 PRESENCE_CONFIG=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \
Brad Bishopbd9931f2017-04-22 16:26:22 -040044 --disable-presence, \
45 virtual/phosphor-fan-presence-config \
46 , \
47"
Brad Bishopbd9931f2017-04-22 16:26:22 -040048
Matt Spinlerc133ec12017-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 Spinlerbde651b2017-05-16 10:49:57 -050052POWERON_TGT = "obmc-chassis-poweron@{0}.target"
53FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040054
Andrew Geisslerfcd78b02019-03-29 14:31:49 +000055FILES_${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
Matt Spinlerc133ec12017-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 Bishopbd9931f2017-04-22 16:26:22 -040058
59# --------------------------------------
60# ${PN}-control specific configuration
Matt Spinlerc133ec12017-04-19 08:23:50 -050061PACKAGECONFIG[control] = "--enable-control \
Brad Bishopc8b67b32019-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 \
Matthew Barth02027942020-02-19 10:38:34 -060065 ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \
Matt Spinlerc133ec12017-04-19 08:23:50 -050066 --disable-control, \
67 virtual/phosphor-fan-control-fan-config \
Brad Bishopc8b67b32019-05-13 23:12:55 -040068 phosphor-fan-control-zone-config \
69 phosphor-fan-control-events-config \
70 phosphor-fan-control-zone-conditions-config \
Matt Spinlerc133ec12017-04-19 08:23:50 -050071 , \
72"
73
Matt Spinlerbde651b2017-05-16 10:49:57 -050074FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
75
Matt Spinlerc133ec12017-04-19 08:23:50 -050076TMPL_CONTROL = "phosphor-fan-control@.service"
77INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -050078FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
79
80TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
81INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
Matthew Barthb5e69d62017-10-24 14:04:46 -050082FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
Matt Spinlerc133ec12017-04-19 08:23:50 -050083
Andrew Geisslerfcd78b02019-03-29 14:31:49 +000084FILES_${PN}-control = "${bindir}/phosphor-fan-control"
Matt Spinlerbde651b2017-05-16 10:49:57 -050085SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
Matt Spinlerc133ec12017-04-19 08:23:50 -050086SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
Matt Spinlerbde651b2017-05-16 10:49:57 -050087SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040088
89# --------------------------------------
Matt Spinlerdd7a0802017-05-01 14:29:20 -050090# ${PN}-monitor specific configuration
91PACKAGECONFIG[monitor] = "--enable-monitor \
Matthew Barth02027942020-02-19 10:38:34 -060092 FAN_MONITOR_YAML_FILE=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \
Matt Spinlerdd7a0802017-05-01 14:29:20 -050093 --disable-monitor, \
Brad Bishopc8b67b32019-05-13 23:12:55 -040094 phosphor-fan-monitor-config \
Matt Spinlerdd7a0802017-05-01 14:29:20 -050095 , \
96"
97
Matt Spinlerdd7a0802017-05-01 14:29:20 -050098TMPL_MONITOR = "phosphor-fan-monitor@.service"
99INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -0500100FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500101
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500102TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
103INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
Matthew Barthb5e69d62017-10-24 14:04:46 -0500104FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500105
Andrew Geisslerfcd78b02019-03-29 14:31:49 +0000106FILES_${PN}-monitor = "${bindir}/phosphor-fan-monitor"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500107SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}"
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500108SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500109SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wymanc50a8c42017-04-28 18:26:45 -0500110
111# --------------------------------------
112# phosphor-cooling-type specific configuration
Brad Bishop4785fdf2017-07-30 21:25:23 -0400113PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,,"