Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 1 | SUMMARY = "Phosphor Fan" |
| 2 | DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \ |
| 3 | control applications." |
| 4 | PR = "r1" |
Patrick Venture | eb43370 | 2018-10-21 08:25:11 -0700 | [diff] [blame] | 5 | PV = "1.0+git${SRCPV}" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 6 | |
Patrick Williams | c7d848e | 2020-04-03 15:48:30 -0500 | [diff] [blame] | 7 | require ${BPN}.inc |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 8 | |
| 9 | inherit autotools pkgconfig pythonnative |
| 10 | inherit obmc-phosphor-systemd |
| 11 | inherit phosphor-fan |
| 12 | |
| 13 | S = "${WORKDIR}/git" |
| 14 | |
| 15 | # Common build dependencies |
| 16 | DEPENDS += "autoconf-archive-native" |
Matthew Barth | fc0ad52 | 2020-02-20 14:48:19 -0600 | [diff] [blame] | 17 | DEPENDS += "${PYTHON_PN}-pyyaml-native" |
| 18 | DEPENDS += "${PYTHON_PN}-mako-native" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 19 | DEPENDS += "sdbusplus" |
Patrick Williams | 2bebd12 | 2020-03-31 16:43:15 -0500 | [diff] [blame] | 20 | DEPENDS += "${PYTHON_PN}-sdbus++-native" |
William A. Kennington III | 581d3c2 | 2018-10-19 18:24:31 -0700 | [diff] [blame] | 21 | DEPENDS += "sdeventplus" |
William A. Kennington III | 8711f98 | 2018-10-29 16:32:26 -0700 | [diff] [blame] | 22 | DEPENDS += "gpioplus" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 23 | DEPENDS += "phosphor-logging" |
Brad Bishop | 0eaba74 | 2017-07-30 21:25:23 -0400 | [diff] [blame] | 24 | DEPENDS += "libevdev" |
Matthew Barth | 0b94fef | 2020-01-14 15:38:05 -0600 | [diff] [blame] | 25 | DEPENDS += "nlohmann-json" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 26 | |
| 27 | # Package configuration |
| 28 | FAN_PACKAGES = " \ |
| 29 | ${PN}-presence-tach \ |
| 30 | ${PN}-control \ |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 31 | ${PN}-monitor \ |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 32 | " |
Brandon Wyman | 0f78628 | 2017-04-28 18:26:45 -0500 | [diff] [blame] | 33 | |
Brad Bishop | 1c5aa36 | 2018-04-11 11:41:50 -0400 | [diff] [blame] | 34 | ALLOW_EMPTY_${PN} = "1" |
| 35 | PACKAGE_BEFORE_PN += "${FAN_PACKAGES}" |
Brandon Wyman | a7b4440 | 2017-06-09 17:50:42 -0500 | [diff] [blame] | 36 | PACKAGECONFIG ?= "presence control monitor" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 37 | SYSTEMD_PACKAGES = "${FAN_PACKAGES}" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 38 | |
| 39 | # -------------------------------------- |
| 40 | # ${PN}-presence-tach specific configuration |
| 41 | PACKAGECONFIG[presence] = " \ |
| 42 | --enable-presence \ |
Brad Bishop | f3b437c | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 43 | PRESENCE_CONFIG=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \ |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 44 | --disable-presence, \ |
| 45 | virtual/phosphor-fan-presence-config \ |
| 46 | , \ |
| 47 | " |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 48 | |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 49 | # Needed to install into the obmc-chassis-poweron target |
| 50 | TMPL_TACH = "phosphor-fan-presence-tach@.service" |
| 51 | INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service" |
Matt Spinler | 29feaa3 | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 52 | POWERON_TGT = "obmc-chassis-poweron@{0}.target" |
| 53 | FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 54 | |
Andrew Geissler | fdb5baf | 2019-03-29 14:31:49 +0000 | [diff] [blame] | 55 | FILES_${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach" |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 56 | SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}" |
| 57 | SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 58 | |
| 59 | # -------------------------------------- |
| 60 | # ${PN}-control specific configuration |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 61 | PACKAGECONFIG[control] = "--enable-control \ |
Brad Bishop | f3b437c | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 62 | 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 Barth | 4161558 | 2020-02-19 10:38:34 -0600 | [diff] [blame] | 65 | ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \ |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 66 | --disable-control, \ |
| 67 | virtual/phosphor-fan-control-fan-config \ |
Brad Bishop | f3b437c | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 68 | phosphor-fan-control-zone-config \ |
| 69 | phosphor-fan-control-events-config \ |
| 70 | phosphor-fan-control-zone-conditions-config \ |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 71 | , \ |
| 72 | " |
| 73 | |
Matt Spinler | 29feaa3 | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 74 | FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target" |
| 75 | |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 76 | TMPL_CONTROL = "phosphor-fan-control@.service" |
| 77 | INSTFMT_CONTROL = "phosphor-fan-control@{0}.service" |
Matt Spinler | 29feaa3 | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 78 | FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}" |
| 79 | |
| 80 | TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service" |
| 81 | INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service" |
Matthew Barth | bc6a750 | 2017-10-24 14:04:46 -0500 | [diff] [blame] | 82 | FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}" |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 83 | |
Andrew Geissler | fdb5baf | 2019-03-29 14:31:49 +0000 | [diff] [blame] | 84 | FILES_${PN}-control = "${bindir}/phosphor-fan-control" |
Matt Spinler | 29feaa3 | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 85 | SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}" |
Matt Spinler | bd9fdd9 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 86 | SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}" |
Matt Spinler | 29feaa3 | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 87 | SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}" |
Brad Bishop | 2c5ba17 | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 88 | |
| 89 | # -------------------------------------- |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 90 | # ${PN}-monitor specific configuration |
| 91 | PACKAGECONFIG[monitor] = "--enable-monitor \ |
Matthew Barth | 4161558 | 2020-02-19 10:38:34 -0600 | [diff] [blame] | 92 | FAN_MONITOR_YAML_FILE=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \ |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 93 | --disable-monitor, \ |
Brad Bishop | f3b437c | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 94 | phosphor-fan-monitor-config \ |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 95 | , \ |
| 96 | " |
| 97 | |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 98 | TMPL_MONITOR = "phosphor-fan-monitor@.service" |
| 99 | INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service" |
Matt Spinler | 29feaa3 | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 100 | FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 101 | |
Matthew Barth | 600d496 | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 102 | TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service" |
| 103 | INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service" |
Matthew Barth | bc6a750 | 2017-10-24 14:04:46 -0500 | [diff] [blame] | 104 | FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}" |
Matthew Barth | 600d496 | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 105 | |
Andrew Geissler | fdb5baf | 2019-03-29 14:31:49 +0000 | [diff] [blame] | 106 | FILES_${PN}-monitor = "${bindir}/phosphor-fan-monitor" |
Matthew Barth | 600d496 | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 107 | SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}" |
Matt Spinler | 39652c8 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 108 | SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}" |
Matthew Barth | 600d496 | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 109 | SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}" |
Brandon Wyman | 0f78628 | 2017-04-28 18:26:45 -0500 | [diff] [blame] | 110 | |
| 111 | # -------------------------------------- |
| 112 | # phosphor-cooling-type specific configuration |
Brad Bishop | 0eaba74 | 2017-07-30 21:25:23 -0400 | [diff] [blame] | 113 | PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,," |