blob: e70bd5baa9d73df3d3d60f4c5f807a7cb9bbfada [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"
5
6require ${PN}.inc
7
8inherit autotools pkgconfig pythonnative
9inherit obmc-phosphor-systemd
10inherit phosphor-fan
11
12S = "${WORKDIR}/git"
13
14# Common build dependencies
15DEPENDS += "autoconf-archive-native"
16DEPENDS += "python-pyyaml-native"
17DEPENDS += "python-mako-native"
18DEPENDS += "sdbusplus"
19DEPENDS += "phosphor-logging"
Brad Bishop0eaba742017-07-30 21:25:23 -040020DEPENDS += "libevdev"
Brad Bishop2c5ba172017-04-22 16:26:22 -040021
22# Package configuration
23FAN_PACKAGES = " \
24 ${PN}-presence-tach \
25 ${PN}-control \
Matt Spinler39652c82017-05-01 14:29:20 -050026 ${PN}-monitor \
Brad Bishop2c5ba172017-04-22 16:26:22 -040027"
Brandon Wyman0f786282017-04-28 18:26:45 -050028
Brad Bishop2c5ba172017-04-22 16:26:22 -040029PACKAGES_remove = "${PN}"
30PACKAGES += "${FAN_PACKAGES}"
Brandon Wymana7b44402017-06-09 17:50:42 -050031PACKAGECONFIG ?= "presence control monitor"
Brad Bishop2c5ba172017-04-22 16:26:22 -040032SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
33RDEPENDS_${PN}-dev = "${FAN_PACKAGES}"
34RDEPENDS_${PN}-staticdev = "${FAN_PACKAGES}"
35
36# --------------------------------------
37# ${PN}-presence-tach specific configuration
38PACKAGECONFIG[presence] = " \
39 --enable-presence \
Brad Bishopb8c1f772017-08-02 14:01:24 -040040 PRESENCE_CONFIG=${STAGING_DIR_NATIVE}${presence_datadir}/config.yaml, \
Brad Bishop2c5ba172017-04-22 16:26:22 -040041 --disable-presence, \
42 virtual/phosphor-fan-presence-config \
43 , \
44"
45RDEPENDS_${PN}-presence-tach += "sdbusplus"
46
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
73RDEPENDS_${PN}-control += "sdbusplus"
74
Matt Spinler29feaa32017-05-16 10:49:57 -050075FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
76
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050077TMPL_CONTROL = "phosphor-fan-control@.service"
78INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -050079FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
80
81TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
82INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
83FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.requires/${INSTFMT_CONTROL_INIT}"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050084
Brad Bishop2c5ba172017-04-22 16:26:22 -040085FILES_${PN}-control = "${sbindir}/phosphor-fan-control"
Matt Spinler29feaa32017-05-16 10:49:57 -050086SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
Matt Spinlerbd9fdd92017-04-19 08:23:50 -050087SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
Matt Spinler29feaa32017-05-16 10:49:57 -050088SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishop2c5ba172017-04-22 16:26:22 -040089
90# --------------------------------------
Matt Spinler39652c82017-05-01 14:29:20 -050091# ${PN}-monitor specific configuration
92PACKAGECONFIG[monitor] = "--enable-monitor \
93 FAN_MONITOR_YAML_FILE=${STAGING_DIR_NATIVE}${monitor_datadir}/monitor.yaml \
94 FAN_MONITOR_OUTPUT_DIR=${S}/monitor, \
95 --disable-monitor, \
96 phosphor-fan-monitor-config-native \
97 , \
98"
99
100RDEPENDS_${PN}-monitor += "sdbusplus"
101
102TMPL_MONITOR = "phosphor-fan-monitor@.service"
103INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
Matt Spinler29feaa32017-05-16 10:49:57 -0500104FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
Matt Spinler39652c82017-05-01 14:29:20 -0500105
106FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor"
107SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR}"
108SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wyman0f786282017-04-28 18:26:45 -0500109
110# --------------------------------------
111# phosphor-cooling-type specific configuration
Brad Bishop0eaba742017-07-30 21:25:23 -0400112PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,,"