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