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 |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 8 | inherit meson pkgconfig python3native |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 9 | inherit obmc-phosphor-systemd |
| 10 | inherit phosphor-fan |
| 11 | |
| 12 | S = "${WORKDIR}/git" |
| 13 | |
| 14 | # Common build dependencies |
Matthew Barth | 700bba0 | 2020-02-20 14:48:19 -0600 | [diff] [blame] | 15 | DEPENDS += "${PYTHON_PN}-pyyaml-native" |
| 16 | DEPENDS += "${PYTHON_PN}-mako-native" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 17 | DEPENDS += "sdbusplus" |
Patrick Williams | 4b32c9a | 2020-03-31 16:43:15 -0500 | [diff] [blame] | 18 | DEPENDS += "${PYTHON_PN}-sdbus++-native" |
William A. Kennington III | aa5d945 | 2018-10-19 18:24:31 -0700 | [diff] [blame] | 19 | DEPENDS += "sdeventplus" |
William A. Kennington III | 3bb26b9 | 2018-10-29 16:32:26 -0700 | [diff] [blame] | 20 | DEPENDS += "gpioplus" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 21 | DEPENDS += "phosphor-logging" |
Brad Bishop | 4785fdf | 2017-07-30 21:25:23 -0400 | [diff] [blame] | 22 | DEPENDS += "libevdev" |
Matthew Barth | 61a59ad | 2020-01-14 15:38:05 -0600 | [diff] [blame] | 23 | DEPENDS += "nlohmann-json" |
Mike Capps | 459d47e | 2021-09-23 14:05:04 -0400 | [diff] [blame] | 24 | DEPENDS += "cli11" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 25 | |
| 26 | # Package configuration |
| 27 | FAN_PACKAGES = " \ |
| 28 | ${PN}-presence-tach \ |
| 29 | ${PN}-control \ |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 30 | ${PN}-monitor \ |
Kumar Thangavel | bf2522d | 2021-11-26 12:03:10 +0530 | [diff] [blame] | 31 | ${PN}-sensor-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 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 34 | ALLOW_EMPTY:${PN} = "1" |
Brad Bishop | 93df99a | 2018-04-11 11:41:50 -0400 | [diff] [blame] | 35 | PACKAGE_BEFORE_PN += "${FAN_PACKAGES}" |
Kumar Thangavel | bf2522d | 2021-11-26 12:03:10 +0530 | [diff] [blame] | 36 | PACKAGECONFIG ?= "presence control monitor sensor-monitor" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 37 | SYSTEMD_PACKAGES = "${FAN_PACKAGES}" |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 38 | EXTRA_OEMESON:append = " -Dtests=disabled" |
Matthew Barth | 2073f7d | 2021-08-19 10:12:05 -0500 | [diff] [blame] | 39 | PKG_DEFAULT_MACHINE ??= "${MACHINE}" |
| 40 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 41 | |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 42 | # The control, monitor, and presence apps can either be JSON or YAML driven. |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 43 | PACKAGECONFIG[json] = "-Djson-config=enabled, -Djson-config=disabled" |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 44 | |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 45 | # -------------------------------------- |
| 46 | # ${PN}-presence-tach specific configuration |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 47 | PACKAGECONFIG[presence] = "-Dpresence-service=enabled \ |
| 48 | -Dmachine-name=${PKG_DEFAULT_MACHINE} \ |
| 49 | -Dpresence-config=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \ |
| 50 | -Dpresence-service=disabled, \ |
Matthew Barth | 2073f7d | 2021-08-19 10:12:05 -0500 | [diff] [blame] | 51 | virtual/phosphor-fan-presence-config \ |
| 52 | , \ |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 53 | " |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 54 | |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 55 | MULTI_USR_TGT = "multi-user.target" |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 56 | TMPL_TACH = "phosphor-fan-presence-tach@.service" |
| 57 | INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service" |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 58 | POWERON_TGT = "obmc-chassis-poweron@{0}.target" |
Matt Spinler | 043052e | 2022-08-01 19:37:43 +0000 | [diff] [blame] | 59 | FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.wants/${INSTFMT_TACH}" |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 60 | FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 61 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 62 | FILES:${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach" |
| 63 | SYSTEMD_SERVICE:${PN}-presence-tach += "${TMPL_TACH}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 64 | 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] | 65 | |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 66 | # JSON mode also gets linked into multi-user |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 67 | SYSTEMD_LINK:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
Matt Spinler | ab79e2a | 2021-01-25 15:25:11 -0600 | [diff] [blame] | 68 | compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_INSTANCES'), '', d)}" |
| 69 | |
Matthew Barth | 2073f7d | 2021-08-19 10:12:05 -0500 | [diff] [blame] | 70 | # Package the JSON config files installed from the repo |
| 71 | FILES:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 72 | '${datadir}/phosphor-fan-presence/presence/*', '', d)}" |
| 73 | |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 74 | # -------------------------------------- |
| 75 | # ${PN}-control specific configuration |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 76 | PACKAGECONFIG[control] = "-Dcontrol-service=enabled \ |
| 77 | -Dmachine-name=${PKG_DEFAULT_MACHINE} \ |
| 78 | -Dfan-def-yaml-file=${STAGING_DIR_HOST}${control_datadir}/fans.yaml \ |
| 79 | -Dfan-zone-yaml-file=${STAGING_DIR_HOST}${control_datadir}/zones.yaml \ |
| 80 | -Dzone-events-yaml-file=${STAGING_DIR_HOST}${control_datadir}/events.yaml \ |
| 81 | -Dzone-conditions-yaml-file=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \ |
| 82 | -Dcontrol-service=disabled, \ |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 83 | virtual/phosphor-fan-control-fan-config \ |
Brad Bishop | c8b67b3 | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 84 | phosphor-fan-control-zone-config \ |
| 85 | phosphor-fan-control-events-config \ |
| 86 | phosphor-fan-control-zone-conditions-config \ |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 87 | , \ |
| 88 | " |
| 89 | |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 90 | FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target" |
| 91 | |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 92 | TMPL_CONTROL = "phosphor-fan-control@.service" |
| 93 | INSTFMT_CONTROL = "phosphor-fan-control@{0}.service" |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 94 | FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}" |
Matthew Barth | cd9db6b | 2021-06-17 16:04:30 -0500 | [diff] [blame] | 95 | FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}" |
Matt Spinler | bddf463 | 2022-01-13 22:31:51 +0000 | [diff] [blame] | 96 | FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.wants/${INSTFMT_CONTROL}" |
Matt Spinler | bde651b | 2017-05-16 10:49:57 -0500 | [diff] [blame] | 97 | |
| 98 | TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service" |
| 99 | INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service" |
Matthew Barth | b5e69d6 | 2017-10-24 14:04:46 -0500 | [diff] [blame] | 100 | FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}" |
Matt Spinler | c133ec1 | 2017-04-19 08:23:50 -0500 | [diff] [blame] | 101 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 102 | FILES:${PN}-control = "${bindir}/phosphor-fan-control" |
Mike Capps | ad3ad6f | 2021-08-26 10:19:09 -0400 | [diff] [blame] | 103 | FILES:${PN}-control += "${bindir}/fanctl" |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 104 | SYSTEMD_SERVICE:${PN}-control += "${TMPL_CONTROL}" |
| 105 | SYSTEMD_SERVICE:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}" |
Matthew Barth | cd9db6b | 2021-06-17 16:04:30 -0500 | [diff] [blame] | 106 | |
| 107 | # JSON: Linked to multi-user and poweron |
| 108 | # YAML: Linked to fans-ready and fan control-init poweron |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 109 | SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
Matthew Barth | cd9db6b | 2021-06-17 16:04:30 -0500 | [diff] [blame] | 110 | compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_INSTANCES'), \ |
| 111 | compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES'), d)}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 112 | SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
Matthew Barth | cd9db6b | 2021-06-17 16:04:30 -0500 | [diff] [blame] | 113 | compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES'), \ |
| 114 | compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}" |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 115 | |
Matthew Barth | f3ee14a | 2021-08-19 10:48:58 -0500 | [diff] [blame] | 116 | # Package the JSON config files installed from the repo |
| 117 | FILES:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 118 | '${datadir}/phosphor-fan-presence/control/*', '', d)}" |
| 119 | |
Brad Bishop | bd9931f | 2017-04-22 16:26:22 -0400 | [diff] [blame] | 120 | # -------------------------------------- |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 121 | # ${PN}-monitor specific configuration |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 122 | PACKAGECONFIG[monitor] = "-Dmonitor-service=enabled \ |
| 123 | -Dmachine-name=${PKG_DEFAULT_MACHINE} \ |
| 124 | -Dfan-monitor-yaml-file=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \ |
| 125 | -Dmonitor-service=disabled, \ |
Brad Bishop | c8b67b3 | 2019-05-13 23:12:55 -0400 | [diff] [blame] | 126 | phosphor-fan-monitor-config \ |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 127 | , \ |
| 128 | " |
| 129 | |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 130 | TMPL_MONITOR = "phosphor-fan-monitor@.service" |
| 131 | INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service" |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 132 | FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" |
Matt Spinler | bddf463 | 2022-01-13 22:31:51 +0000 | [diff] [blame] | 133 | FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.wants/${INSTFMT_MONITOR}" |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 134 | FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}" |
Matt Spinler | dd7a080 | 2017-05-01 14:29:20 -0500 | [diff] [blame] | 135 | |
Matthew Barth | cac2ecf | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 136 | TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service" |
| 137 | INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service" |
Matthew Barth | b5e69d6 | 2017-10-24 14:04:46 -0500 | [diff] [blame] | 138 | FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}" |
Matthew Barth | cac2ecf | 2017-08-23 13:18:01 -0500 | [diff] [blame] | 139 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 140 | FILES:${PN}-monitor = "${bindir}/phosphor-fan-monitor" |
| 141 | SYSTEMD_SERVICE:${PN}-monitor += "${TMPL_MONITOR}" |
| 142 | SYSTEMD_SERVICE:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}" |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 143 | |
| 144 | # JSON: power on and multi-user links. YAML: fans-ready and fan monitor init links |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 145 | SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 146 | compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_INSTANCES'), \ |
| 147 | compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_INSTANCES'), d)}" |
| 148 | |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 149 | SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
Matt Spinler | d793c99 | 2021-02-12 13:02:05 -0600 | [diff] [blame] | 150 | compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \ |
| 151 | compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}" |
Brandon Wyman | c50a8c4 | 2017-04-28 18:26:45 -0500 | [diff] [blame] | 152 | |
Matthew Barth | be61d22 | 2021-08-19 10:40:30 -0500 | [diff] [blame] | 153 | # Package the JSON config files installed from the repo |
| 154 | FILES:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ |
| 155 | '${datadir}/phosphor-fan-presence/monitor/*', '', d)}" |
| 156 | |
Brandon Wyman | c50a8c4 | 2017-04-28 18:26:45 -0500 | [diff] [blame] | 157 | # -------------------------------------- |
| 158 | # phosphor-cooling-type specific configuration |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 159 | PACKAGECONFIG[cooling-type] = "-Dcooling-type-service=enabled,-Dcooling-type-service=disabled,," |
Matt Spinler | 7fc35dd | 2021-02-12 09:56:17 -0600 | [diff] [blame] | 160 | # -------------------------------------- |
| 161 | # ${PN}-sensor-monitor specific configuration |
Matt Spinler | cb26287 | 2022-08-12 21:44:17 +0000 | [diff] [blame^] | 162 | PACKAGECONFIG[sensor-monitor] = "-Dsensor-monitor-service=enabled,-Dsensor-monitor-service=disabled" |
Matt Spinler | 7fc35dd | 2021-02-12 09:56:17 -0600 | [diff] [blame] | 163 | |
Kumar Thangavel | bf2522d | 2021-11-26 12:03:10 +0530 | [diff] [blame] | 164 | FAN_PACKAGES:append = "${@bb.utils.contains('PACKAGECONFIG', 'sensor-monitor', ' sensor-monitor', '', d)}" |
| 165 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 166 | FILES:sensor-monitor += " ${bindir}/sensor-monitor" |
| 167 | SYSTEMD_SERVICE:sensor-monitor += "sensor-monitor.service" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 168 | SYSTEMD_LINK:sensor-monitor += "../sensor-monitor.service:${MULTI_USR_TGT}.wants/sensor-monitor.service" |