blob: 61158993e1dbfb03fd1852211fac4ee2e0eee54e [file] [log] [blame]
Brad Bishop2c5ba172017-04-22 16:26:22 -04001SUMMARY = "Phosphor Fan"
2DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \
3control applications."
4PR = "r1"
Patrick Ventureeb433702018-10-21 08:25:11 -07005PV = "1.0+git${SRCPV}"
Brad Bishop2c5ba172017-04-22 16:26:22 -04006
7require ${PN}.inc
8
9inherit autotools pkgconfig pythonnative
10inherit obmc-phosphor-systemd
11inherit phosphor-fan
12
13S = "${WORKDIR}/git"
14
15# Common build dependencies
16DEPENDS += "autoconf-archive-native"
17DEPENDS += "python-pyyaml-native"
18DEPENDS += "python-mako-native"
19DEPENDS += "sdbusplus"
Brad Bishopf06d3b62018-01-26 21:48:20 -050020DEPENDS += "sdbusplus-native"
William A. Kennington III581d3c22018-10-19 18:24:31 -070021DEPENDS += "sdeventplus"
Brad Bishop2c5ba172017-04-22 16:26:22 -040022DEPENDS += "phosphor-logging"
Brad Bishop0eaba742017-07-30 21:25:23 -040023DEPENDS += "libevdev"
Brad Bishop2c5ba172017-04-22 16:26:22 -040024
25# Package configuration
26FAN_PACKAGES = " \
27 ${PN}-presence-tach \
28 ${PN}-control \
Matt Spinler39652c82017-05-01 14:29:20 -050029 ${PN}-monitor \
Brad Bishop2c5ba172017-04-22 16:26:22 -040030"
Brandon Wyman0f786282017-04-28 18:26:45 -050031
Brad Bishop1c5aa362018-04-11 11:41:50 -040032ALLOW_EMPTY_${PN} = "1"
33PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
Brandon Wymana7b44402017-06-09 17:50:42 -050034PACKAGECONFIG ?= "presence control monitor"
Brad Bishop2c5ba172017-04-22 16:26:22 -040035SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040036
37# --------------------------------------
38# ${PN}-presence-tach specific configuration
39PACKAGECONFIG[presence] = " \
40 --enable-presence \
Brad Bishopb8c1f772017-08-02 14:01:24 -040041 PRESENCE_CONFIG=${STAGING_DIR_NATIVE}${presence_datadir}/config.yaml, \
Brad Bishop2c5ba172017-04-22 16:26:22 -040042 --disable-presence, \
43 virtual/phosphor-fan-presence-config \
44 , \
45"
Brad Bishop2c5ba172017-04-22 16:26:22 -040046
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050047# Needed to install into the obmc-chassis-poweron target
48TMPL_TACH = "phosphor-fan-presence-tach@.service"
49INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -050050POWERON_TGT = "obmc-chassis-poweron@{0}.target"
51FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040052
53FILES_${PN}-presence-tach = "${sbindir}/phosphor-fan-presence-tach"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050054SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}"
55SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040056
57# --------------------------------------
58# ${PN}-control specific configuration
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050059PACKAGECONFIG[control] = "--enable-control \
60 FAN_DEF_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/fans.yaml \
61 FAN_ZONE_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zones.yaml \
Matthew Barth5f26abf2017-05-24 17:06:13 -050062 ZONE_EVENTS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/events.yaml \
Gunnar Mills9b6cc242017-06-26 11:35:38 -050063 ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zone_conditions.yaml \
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050064 FAN_ZONE_OUTPUT_DIR=${S}/control, \
65 --disable-control, \
66 virtual/phosphor-fan-control-fan-config \
67 phosphor-fan-control-zone-config-native \
Matthew Barth5f26abf2017-05-24 17:06:13 -050068 phosphor-fan-control-events-config-native \
Gunnar Mills9b6cc242017-06-26 11:35:38 -050069 phosphor-fan-control-zone-conditions-config-native \
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050070 , \
71"
72
Matt Spinler29feaa32017-05-16 10:49:57 -050073FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
74
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050075TMPL_CONTROL = "phosphor-fan-control@.service"
76INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -050077FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
78
79TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
80INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
Matthew Barthbc6a7502017-10-24 14:04:46 -050081FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050082
Brad Bishop2c5ba172017-04-22 16:26:22 -040083FILES_${PN}-control = "${sbindir}/phosphor-fan-control"
Matt Spinler29feaa32017-05-16 10:49:57 -050084SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050085SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
Matt Spinler29feaa32017-05-16 10:49:57 -050086SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040087
88# --------------------------------------
Matt Spinler39652c82017-05-01 14:29:20 -050089# ${PN}-monitor specific configuration
90PACKAGECONFIG[monitor] = "--enable-monitor \
91 FAN_MONITOR_YAML_FILE=${STAGING_DIR_NATIVE}${monitor_datadir}/monitor.yaml \
92 FAN_MONITOR_OUTPUT_DIR=${S}/monitor, \
93 --disable-monitor, \
94 phosphor-fan-monitor-config-native \
95 , \
96"
97
Matt Spinler39652c82017-05-01 14:29:20 -050098TMPL_MONITOR = "phosphor-fan-monitor@.service"
99INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -0500100FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
Matt Spinler39652c82017-05-01 14:29:20 -0500101
Matthew Barth600d4962017-08-23 13:18:01 -0500102TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
103INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
Matthew Barthbc6a7502017-10-24 14:04:46 -0500104FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
Matthew Barth600d4962017-08-23 13:18:01 -0500105
Matt Spinler39652c82017-05-01 14:29:20 -0500106FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor"
Matthew Barth600d4962017-08-23 13:18:01 -0500107SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}"
Matt Spinler39652c82017-05-01 14:29:20 -0500108SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth600d4962017-08-23 13:18:01 -0500109SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wyman0f786282017-04-28 18:26:45 -0500110
111# --------------------------------------
112# phosphor-cooling-type specific configuration
Brad Bishop0eaba742017-07-30 21:25:23 -0400113PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,,"