blob: adad349002f8602f541d9fbc00b5c04c45fdaa0f [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
Patrick Williamsfb700fd2020-04-03 15:48:30 -05007require ${BPN}.inc
Brad Bishopbd9931f2017-04-22 16:26:22 -04008
Andrew Geisslerae60c9c2020-04-02 21:31:02 +00009inherit autotools pkgconfig python3native
Brad Bishopbd9931f2017-04-22 16:26:22 -040010inherit obmc-phosphor-systemd
11inherit phosphor-fan
12
13S = "${WORKDIR}/git"
14
15# Common build dependencies
16DEPENDS += "autoconf-archive-native"
Matthew Barth700bba02020-02-20 14:48:19 -060017DEPENDS += "${PYTHON_PN}-pyyaml-native"
18DEPENDS += "${PYTHON_PN}-mako-native"
Brad Bishopbd9931f2017-04-22 16:26:22 -040019DEPENDS += "sdbusplus"
Patrick Williams4b32c9a2020-03-31 16:43:15 -050020DEPENDS += "${PYTHON_PN}-sdbus++-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
Matt Spinlerab79e2a2021-01-25 15:25:11 -060039# The control, monitor, and presence apps can either be JSON or YAML driven.
40PACKAGECONFIG[json] = "--enable-json, --disable-json"
41
Brad Bishopbd9931f2017-04-22 16:26:22 -040042# --------------------------------------
43# ${PN}-presence-tach specific configuration
44PACKAGECONFIG[presence] = " \
45 --enable-presence \
Brad Bishopc8b67b32019-05-13 23:12:55 -040046 PRESENCE_CONFIG=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \
Brad Bishopbd9931f2017-04-22 16:26:22 -040047 --disable-presence, \
48 virtual/phosphor-fan-presence-config \
49 , \
50"
Brad Bishopbd9931f2017-04-22 16:26:22 -040051
Matt Spinlerab79e2a2021-01-25 15:25:11 -060052MULTI_USR_TGT = "multi-user.target"
Matt Spinlerc133ec12017-04-19 08:23:50 -050053TMPL_TACH = "phosphor-fan-presence-tach@.service"
54INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -050055POWERON_TGT = "obmc-chassis-poweron@{0}.target"
56FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
Matt Spinlerab79e2a2021-01-25 15:25:11 -060057FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040058
Andrew Geisslerfcd78b02019-03-29 14:31:49 +000059FILES_${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
Matt Spinlerc133ec12017-04-19 08:23:50 -050060SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}"
61SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040062
Matt Spinlerab79e2a2021-01-25 15:25:11 -060063# JSON mode also gets linked into multi-user
64SYSTEMD_LINK_${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
65 compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_INSTANCES'), '', d)}"
66
Brad Bishopbd9931f2017-04-22 16:26:22 -040067# --------------------------------------
68# ${PN}-control specific configuration
Matt Spinlerc133ec12017-04-19 08:23:50 -050069PACKAGECONFIG[control] = "--enable-control \
Brad Bishopc8b67b32019-05-13 23:12:55 -040070 FAN_DEF_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/fans.yaml \
71 FAN_ZONE_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zones.yaml \
72 ZONE_EVENTS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/events.yaml \
Matthew Barth02027942020-02-19 10:38:34 -060073 ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \
Matt Spinlerc133ec12017-04-19 08:23:50 -050074 --disable-control, \
75 virtual/phosphor-fan-control-fan-config \
Brad Bishopc8b67b32019-05-13 23:12:55 -040076 phosphor-fan-control-zone-config \
77 phosphor-fan-control-events-config \
78 phosphor-fan-control-zone-conditions-config \
Matt Spinlerc133ec12017-04-19 08:23:50 -050079 , \
80"
81
Matt Spinlerbde651b2017-05-16 10:49:57 -050082FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
83
Matt Spinlerc133ec12017-04-19 08:23:50 -050084TMPL_CONTROL = "phosphor-fan-control@.service"
85INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -050086FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
87
88TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
89INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
Matthew Barthb5e69d62017-10-24 14:04:46 -050090FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
Matt Spinlerc133ec12017-04-19 08:23:50 -050091
Andrew Geisslerfcd78b02019-03-29 14:31:49 +000092FILES_${PN}-control = "${bindir}/phosphor-fan-control"
Matt Spinlerbde651b2017-05-16 10:49:57 -050093SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
Matt Spinlerc133ec12017-04-19 08:23:50 -050094SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
Matt Spinlerbde651b2017-05-16 10:49:57 -050095SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040096
97# --------------------------------------
Matt Spinlerdd7a0802017-05-01 14:29:20 -050098# ${PN}-monitor specific configuration
99PACKAGECONFIG[monitor] = "--enable-monitor \
Matthew Barth02027942020-02-19 10:38:34 -0600100 FAN_MONITOR_YAML_FILE=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500101 --disable-monitor, \
Brad Bishopc8b67b32019-05-13 23:12:55 -0400102 phosphor-fan-monitor-config \
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500103 , \
104"
105
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500106TMPL_MONITOR = "phosphor-fan-monitor@.service"
107INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -0500108FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500109
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500110TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
111INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
Matthew Barthb5e69d62017-10-24 14:04:46 -0500112FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500113
Andrew Geisslerfcd78b02019-03-29 14:31:49 +0000114FILES_${PN}-monitor = "${bindir}/phosphor-fan-monitor"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500115SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}"
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500116SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500117SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wymanc50a8c42017-04-28 18:26:45 -0500118
119# --------------------------------------
120# phosphor-cooling-type specific configuration
Brad Bishop4785fdf2017-07-30 21:25:23 -0400121PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,,"