blob: a8eecf8e6ac66bdc3feea283efa958744b56a152 [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."
Brad Bishopbd9931f2017-04-22 16:26:22 -04004# Common build dependencies
Matthew Barth700bba02020-02-20 14:48:19 -06005DEPENDS += "${PYTHON_PN}-pyyaml-native"
6DEPENDS += "${PYTHON_PN}-mako-native"
Brad Bishopbd9931f2017-04-22 16:26:22 -04007DEPENDS += "sdbusplus"
Patrick Williams4b32c9a2020-03-31 16:43:15 -05008DEPENDS += "${PYTHON_PN}-sdbus++-native"
William A. Kennington IIIaa5d9452018-10-19 18:24:31 -07009DEPENDS += "sdeventplus"
William A. Kennington III3bb26b92018-10-29 16:32:26 -070010DEPENDS += "gpioplus"
Brad Bishopbd9931f2017-04-22 16:26:22 -040011DEPENDS += "phosphor-logging"
Brad Bishop4785fdf2017-07-30 21:25:23 -040012DEPENDS += "libevdev"
Matthew Barth61a59ad2020-01-14 15:38:05 -060013DEPENDS += "nlohmann-json"
Mike Capps459d47e2021-09-23 14:05:04 -040014DEPENDS += "cli11"
Kumar Thangavelbf2522d2021-11-26 12:03:10 +053015PACKAGECONFIG ?= "presence control monitor sensor-monitor"
Matt Spinlerab79e2a2021-01-25 15:25:11 -060016# The control, monitor, and presence apps can either be JSON or YAML driven.
Matt Spinlercb262872022-08-12 21:44:17 +000017PACKAGECONFIG[json] = "-Djson-config=enabled, -Djson-config=disabled"
Brad Bishopbd9931f2017-04-22 16:26:22 -040018# --------------------------------------
19# ${PN}-presence-tach specific configuration
Matt Spinlercb262872022-08-12 21:44:17 +000020PACKAGECONFIG[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 Barth2073f7d2021-08-19 10:12:05 -050024 virtual/phosphor-fan-presence-config \
25 , \
Brad Bishopbd9931f2017-04-22 16:26:22 -040026"
Brad Bishopbd9931f2017-04-22 16:26:22 -040027# --------------------------------------
28# ${PN}-control specific configuration
Matt Spinlercb262872022-08-12 21:44:17 +000029PACKAGECONFIG[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 Spinlerc133ec12017-04-19 08:23:50 -050036 virtual/phosphor-fan-control-fan-config \
Brad Bishopc8b67b32019-05-13 23:12:55 -040037 phosphor-fan-control-zone-config \
38 phosphor-fan-control-events-config \
39 phosphor-fan-control-zone-conditions-config \
Matt Spinlerc133ec12017-04-19 08:23:50 -050040 , \
41"
Brad Bishopbd9931f2017-04-22 16:26:22 -040042# --------------------------------------
Matt Spinlerdd7a0802017-05-01 14:29:20 -050043# ${PN}-monitor specific configuration
Matt Spinlercb262872022-08-12 21:44:17 +000044PACKAGECONFIG[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 Bishopc8b67b32019-05-13 23:12:55 -040048 phosphor-fan-monitor-config \
Matt Spinlerdd7a0802017-05-01 14:29:20 -050049 , \
50"
Brandon Wymanc50a8c42017-04-28 18:26:45 -050051# --------------------------------------
52# phosphor-cooling-type specific configuration
Matt Spinlercb262872022-08-12 21:44:17 +000053PACKAGECONFIG[cooling-type] = "-Dcooling-type-service=enabled,-Dcooling-type-service=disabled,,"
Matt Spinler7fc35dd2021-02-12 09:56:17 -060054# --------------------------------------
55# ${PN}-sensor-monitor specific configuration
Matt Spinlercb262872022-08-12 21:44:17 +000056PACKAGECONFIG[sensor-monitor] = "-Dsensor-monitor-service=enabled,-Dsensor-monitor-service=disabled"
Ed Tanous9936f862022-09-19 09:13:20 -070057PV = "1.0+git${SRCPV}"
58PR = "r1"
Matt Spinler7fc35dd2021-02-12 09:56:17 -060059
Ed Tanous9936f862022-09-19 09:13:20 -070060S = "${WORKDIR}/git"
61SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
62SYSTEMD_SERVICE:${PN}-presence-tach += "${TMPL_TACH}"
63SYSTEMD_LINK:${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
64# JSON mode also gets linked into multi-user
65SYSTEMD_LINK:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
66 compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_INSTANCES'), '', d)}"
67SYSTEMD_SERVICE:${PN}-control += "${TMPL_CONTROL}"
68SYSTEMD_SERVICE:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}"
69# JSON: Linked to multi-user and poweron
70# YAML: Linked to fans-ready and fan control-init poweron
71SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
72 compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
73 compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES'), d)}"
74SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
75 compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES'), \
76 compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"
77SYSTEMD_SERVICE:${PN}-monitor += "${TMPL_MONITOR}"
78SYSTEMD_SERVICE:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}"
79# JSON: power on and multi-user links. YAML: fans-ready and fan monitor init links
80SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
81 compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_INSTANCES'), \
82 compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_INSTANCES'), d)}"
83SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
84 compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
85 compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"
Patrick Williams12fc9392021-08-06 09:16:53 -050086SYSTEMD_SERVICE:sensor-monitor += "sensor-monitor.service"
Patrick Williamse83c2202021-09-01 16:17:33 -050087SYSTEMD_LINK:sensor-monitor += "../sensor-monitor.service:${MULTI_USR_TGT}.wants/sensor-monitor.service"
Ed Tanous9936f862022-09-19 09:13:20 -070088
89inherit meson pkgconfig python3native
90inherit obmc-phosphor-systemd
91inherit phosphor-fan
92
93EXTRA_OEMESON:append = " -Dtests=disabled"
94
95PACKAGE_ARCH = "${MACHINE_ARCH}"
96
97FILES:${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
98# Package the JSON config files installed from the repo
99FILES:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
100 '${datadir}/phosphor-fan-presence/presence/*', '', d)}"
101FILES:${PN}-control = "${bindir}/phosphor-fan-control"
102FILES:${PN}-control += "${bindir}/fanctl"
103# Package the JSON config files installed from the repo
104FILES:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
105 '${datadir}/phosphor-fan-presence/control/*', '', d)}"
106FILES:${PN}-monitor = "${bindir}/phosphor-fan-monitor"
107# Package the JSON config files installed from the repo
108FILES:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
109 '${datadir}/phosphor-fan-presence/monitor/*', '', d)}"
110FILES:sensor-monitor += " ${bindir}/sensor-monitor"
111
112require ${BPN}.inc
113
114ALLOW_EMPTY:${PN} = "1"
115
116PKG_DEFAULT_MACHINE ??= "${MACHINE}"
117
118# Package configuration
119FAN_PACKAGES = " \
120 ${PN}-presence-tach \
121 ${PN}-control \
122 ${PN}-monitor \
123 ${PN}-sensor-monitor \
124"
125PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
126MULTI_USR_TGT = "multi-user.target"
127TMPL_TACH = "phosphor-fan-presence-tach@.service"
128INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
129POWERON_TGT = "obmc-chassis-poweron@{0}.target"
130FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.wants/${INSTFMT_TACH}"
131FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}"
132FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
133TMPL_CONTROL = "phosphor-fan-control@.service"
134INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
135FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
136FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
137FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.wants/${INSTFMT_CONTROL}"
138TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
139INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
140FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
141TMPL_MONITOR = "phosphor-fan-monitor@.service"
142INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
143FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
144FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.wants/${INSTFMT_MONITOR}"
145FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}"
146TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
147INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
148FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
149FAN_PACKAGES:append = "${@bb.utils.contains('PACKAGECONFIG', 'sensor-monitor', ' sensor-monitor', '', d)}"