Brad Bishop | bd9931f | 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 | 5def7e7 | 2018-10-21 08:25:11 -0700 | [diff] [blame] | 5 | PV = "1.0+git${SRCPV}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 6 | |
Patrick Williams | fb700fd | 2020-04-03 15:48:30 -0500 | [diff] [blame] | 7 | require ${BPN}.inc |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 8 | |
Andrew Geissler | ae60c9c | 2020-04-02 21:31:02 +0000 | [diff] [blame] | 9 | inherit autotools pkgconfig python3native |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 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 | 700bba0 | 2020-02-20 14:48:19 -0600 | [diff] [blame] | 17 | DEPENDS += "${PYTHON_PN}-pyyaml-native" |
| 18 | DEPENDS += "${PYTHON_PN}-mako-native" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 19 | DEPENDS += "sdbusplus" |
Patrick Williams | 4b32c9a | 2020-03-31 16:43:15 -0500 | [diff] [blame] | 20 | DEPENDS += "${PYTHON_PN}-sdbus++-native" |
William A. Kennington III | aa5d945 | 2018-10-19 18:24:31 -0700 | [diff] [blame] | 21 | DEPENDS += "sdeventplus" |
William A. Kennington III | 3bb26b9 | 2018-10-29 16:32:26 -0700 | [diff] [blame] | 22 | DEPENDS += "gpioplus" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 23 | DEPENDS += "phosphor-logging" |
Brad Bishop | 4785fdf | 2017-07-30 21:25:23 -0400 | [diff] [blame] | 24 | DEPENDS += "libevdev" |
Matthew Barth | 61a59ad | 2020-01-14 15:38:05 -0600 | [diff] [blame] | 25 | DEPENDS += "nlohmann-json" |
Brad Bishop | bd9931f | 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 | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 31 | ${PN}-monitor \ |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 32 | " |
Brandon Wyman | c50a8c4 | 2017-04-28 18:26:45 -0500 | [diff] [blame] | 33 | |
Brad Bishop | 93df99a | 2018-04-11 11:41:50 -0400 | [diff] [blame] | 34 | ALLOW_EMPTY_${PN} = "1" |
| 35 | PACKAGE_BEFORE_PN += "${FAN_PACKAGES}" |
Brandon Wyman | 5b42b74 | 2017-06-09 17:50:42 -0500 | [diff] [blame] | 36 | PACKAGECONFIG ?= "presence control monitor" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 37 | SYSTEMD_PACKAGES = "${FAN_PACKAGES}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 38 | |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 39 | # The control, monitor, and presence apps can either be JSON or YAML driven. |
| 40 | PACKAGECONFIG[json] = "--enable-json, --disable-json" |
| 41 | |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 42 | # -------------------------------------- |
| 43 | # ${PN}-presence-tach specific configuration |
| 44 | PACKAGECONFIG[presence] = " \ |
| 45 | --enable-presence \ |
Brad Bishop | c8b67b3 | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 46 | PRESENCE_CONFIG=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \ |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 47 | --disable-presence, \ |
| 48 | virtual/phosphor-fan-presence-config \ |
| 49 | , \ |
| 50 | " |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 51 | |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 52 | MULTI_USR_TGT = "multi-user.target" |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 53 | TMPL_TACH = "phosphor-fan-presence-tach@.service" |
| 54 | INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service" |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 55 | POWERON_TGT = "obmc-chassis-poweron@{0}.target" |
| 56 | FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}" |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 57 | FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 58 | |
Andrew Geissler | fcd78b0 | 2019-03-29 14:31:49 +0000 | [diff] [blame] | 59 | FILES_${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach" |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 60 | SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}" |
| 61 | SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 62 | |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 63 | # JSON mode also gets linked into multi-user |
| 64 | SYSTEMD_LINK_${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 65 | compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_INSTANCES'), '', d)}" |
| 66 | |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 67 | # -------------------------------------- |
| 68 | # ${PN}-control specific configuration |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 69 | PACKAGECONFIG[control] = "--enable-control \ |
Brad Bishop | c8b67b3 | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 70 | 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 Barth | 0202794 | 2020-02-19 10:38:34 -0600 | [diff] [blame] | 73 | ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \ |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 74 | --disable-control, \ |
| 75 | virtual/phosphor-fan-control-fan-config \ |
Brad Bishop | c8b67b3 | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 76 | phosphor-fan-control-zone-config \ |
| 77 | phosphor-fan-control-events-config \ |
| 78 | phosphor-fan-control-zone-conditions-config \ |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 79 | , \ |
| 80 | " |
| 81 | |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 82 | FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target" |
| 83 | |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 84 | TMPL_CONTROL = "phosphor-fan-control@.service" |
| 85 | INSTFMT_CONTROL = "phosphor-fan-control@{0}.service" |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 86 | FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}" |
Matthew Barth | cd9db6b | 2021-06-17 16:04:30 -0500 | [diff] [blame^] | 87 | FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}" |
| 88 | FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.requires/${INSTFMT_CONTROL}" |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 89 | |
| 90 | TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service" |
| 91 | INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service" |
Matthew Barth | b5e69d6 | 2017-10-24 14:04:46 -0500 | [diff] [blame] | 92 | FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}" |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 93 | |
Andrew Geissler | fcd78b0 | 2019-03-29 14:31:49 +0000 | [diff] [blame] | 94 | FILES_${PN}-control = "${bindir}/phosphor-fan-control" |
Matthew Barth | cd9db6b | 2021-06-17 16:04:30 -0500 | [diff] [blame^] | 95 | SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL}" |
| 96 | SYSTEMD_SERVICE_${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}" |
| 97 | |
| 98 | # JSON: Linked to multi-user and poweron |
| 99 | # YAML: Linked to fans-ready and fan control-init poweron |
| 100 | SYSTEMD_LINK_${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 101 | compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_INSTANCES'), \ |
| 102 | compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES'), d)}" |
| 103 | SYSTEMD_LINK_${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 104 | compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES'), \ |
| 105 | compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 106 | |
| 107 | # -------------------------------------- |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 108 | # ${PN}-monitor specific configuration |
| 109 | PACKAGECONFIG[monitor] = "--enable-monitor \ |
Matthew Barth | 0202794 | 2020-02-19 10:38:34 -0600 | [diff] [blame] | 110 | FAN_MONITOR_YAML_FILE=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \ |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 111 | --disable-monitor, \ |
Brad Bishop | c8b67b3 | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 112 | phosphor-fan-monitor-config \ |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 113 | , \ |
| 114 | " |
| 115 | |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 116 | TMPL_MONITOR = "phosphor-fan-monitor@.service" |
| 117 | INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service" |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 118 | FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" |
| 119 | FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.requires/${INSTFMT_MONITOR}" |
| 120 | FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}" |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 121 | |
Matthew Barth | cac2ecf | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 122 | TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service" |
| 123 | INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service" |
Matthew Barth | b5e69d6 | 2017-10-24 14:04:46 -0500 | [diff] [blame] | 124 | FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}" |
Matthew Barth | cac2ecf | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 125 | |
Andrew Geissler | fcd78b0 | 2019-03-29 14:31:49 +0000 | [diff] [blame] | 126 | FILES_${PN}-monitor = "${bindir}/phosphor-fan-monitor" |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 127 | SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR}" |
| 128 | SYSTEMD_SERVICE_${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}" |
| 129 | |
| 130 | # JSON: power on and multi-user links. YAML: fans-ready and fan monitor init links |
| 131 | SYSTEMD_LINK_${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 132 | compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_INSTANCES'), \ |
| 133 | compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_INSTANCES'), d)}" |
| 134 | |
| 135 | SYSTEMD_LINK_${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 136 | compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \ |
| 137 | compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}" |
Brandon Wyman | c50a8c4 | 2017-04-28 18:26:45 -0500 | [diff] [blame] | 138 | |
| 139 | # -------------------------------------- |
| 140 | # phosphor-cooling-type specific configuration |
Brad Bishop | 4785fdf | 2017-07-30 21:25:23 -0400 | [diff] [blame] | 141 | PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,," |
Matt Spinler | 7fc35dd | 2021-02-12 09:56:17 -0600 | [diff] [blame] | 142 | |
| 143 | # -------------------------------------- |
| 144 | # ${PN}-sensor-monitor specific configuration |
| 145 | PACKAGECONFIG[sensor-monitor] = "--enable-sensor-monitor, --disable-sensor-monitor" |
| 146 | |
| 147 | FILES_sensor-monitor += " ${bindir}/sensor-monitor" |
| 148 | SYSTEMD_SERVICE_sensor-monitor += "sensor-monitor.service" |
| 149 | SYSTEMD_LINK_sensor-monitor += "../sensor-monitor.service:${MULTI_USR_TGT}.wants/sensor-monitor.service" |