blob: 9e4db307a4c12f04a4387cc457bac11b0651918c [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."
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"
Brad Bishop04ff12c2018-01-26 21:48:20 -050019DEPENDS += "sdbusplus-native"
Brad Bishopbd9931f2017-04-22 16:26:22 -040020DEPENDS += "phosphor-logging"
Brad Bishop4785fdf2017-07-30 21:25:23 -040021DEPENDS += "libevdev"
Brad Bishopbd9931f2017-04-22 16:26:22 -040022
23# Package configuration
24FAN_PACKAGES = " \
25 ${PN}-presence-tach \
26 ${PN}-control \
Matt Spinlerdd7a0802017-05-01 14:29:20 -050027 ${PN}-monitor \
Brad Bishopbd9931f2017-04-22 16:26:22 -040028"
Brandon Wymanc50a8c42017-04-28 18:26:45 -050029
Brad Bishop93df99a2018-04-11 11:41:50 -040030ALLOW_EMPTY_${PN} = "1"
31PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
Brandon Wyman5b42b742017-06-09 17:50:42 -050032PACKAGECONFIG ?= "presence control monitor"
Brad Bishopbd9931f2017-04-22 16:26:22 -040033SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040034
35# --------------------------------------
36# ${PN}-presence-tach specific configuration
37PACKAGECONFIG[presence] = " \
38 --enable-presence \
Brad Bishop8861a872017-08-02 14:01:24 -040039 PRESENCE_CONFIG=${STAGING_DIR_NATIVE}${presence_datadir}/config.yaml, \
Brad Bishopbd9931f2017-04-22 16:26:22 -040040 --disable-presence, \
41 virtual/phosphor-fan-presence-config \
42 , \
43"
44RDEPENDS_${PN}-presence-tach += "sdbusplus"
45
Matt Spinlerc133ec12017-04-19 08:23:50 -050046# Needed to install into the obmc-chassis-poweron target
47TMPL_TACH = "phosphor-fan-presence-tach@.service"
48INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -050049POWERON_TGT = "obmc-chassis-poweron@{0}.target"
50FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040051
52FILES_${PN}-presence-tach = "${sbindir}/phosphor-fan-presence-tach"
Matt Spinlerc133ec12017-04-19 08:23:50 -050053SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}"
54SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040055
56# --------------------------------------
57# ${PN}-control specific configuration
Matt Spinlerc133ec12017-04-19 08:23:50 -050058PACKAGECONFIG[control] = "--enable-control \
59 FAN_DEF_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/fans.yaml \
60 FAN_ZONE_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zones.yaml \
Matthew Barth2bfd71d2017-05-24 17:06:13 -050061 ZONE_EVENTS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/events.yaml \
Gunnar Millsc8228da2017-06-26 11:35:38 -050062 ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zone_conditions.yaml \
Matt Spinlerc133ec12017-04-19 08:23:50 -050063 FAN_ZONE_OUTPUT_DIR=${S}/control, \
64 --disable-control, \
65 virtual/phosphor-fan-control-fan-config \
66 phosphor-fan-control-zone-config-native \
Matthew Barth2bfd71d2017-05-24 17:06:13 -050067 phosphor-fan-control-events-config-native \
Gunnar Millsc8228da2017-06-26 11:35:38 -050068 phosphor-fan-control-zone-conditions-config-native \
Matt Spinlerc133ec12017-04-19 08:23:50 -050069 , \
70"
71
72RDEPENDS_${PN}-control += "sdbusplus"
73
Matt Spinlerbde651b2017-05-16 10:49:57 -050074FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
75
Matt Spinlerc133ec12017-04-19 08:23:50 -050076TMPL_CONTROL = "phosphor-fan-control@.service"
77INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -050078FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
79
80TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
81INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
Matthew Barthb5e69d62017-10-24 14:04:46 -050082FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
Matt Spinlerc133ec12017-04-19 08:23:50 -050083
Brad Bishopbd9931f2017-04-22 16:26:22 -040084FILES_${PN}-control = "${sbindir}/phosphor-fan-control"
Matt Spinlerbde651b2017-05-16 10:49:57 -050085SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
Matt Spinlerc133ec12017-04-19 08:23:50 -050086SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
Matt Spinlerbde651b2017-05-16 10:49:57 -050087SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brad Bishopbd9931f2017-04-22 16:26:22 -040088
89# --------------------------------------
Matt Spinlerdd7a0802017-05-01 14:29:20 -050090# ${PN}-monitor specific configuration
91PACKAGECONFIG[monitor] = "--enable-monitor \
92 FAN_MONITOR_YAML_FILE=${STAGING_DIR_NATIVE}${monitor_datadir}/monitor.yaml \
93 FAN_MONITOR_OUTPUT_DIR=${S}/monitor, \
94 --disable-monitor, \
95 phosphor-fan-monitor-config-native \
96 , \
97"
98
99RDEPENDS_${PN}-monitor += "sdbusplus"
100
101TMPL_MONITOR = "phosphor-fan-monitor@.service"
102INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
Matt Spinlerbde651b2017-05-16 10:49:57 -0500103FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500104
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500105TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
106INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
Matthew Barthb5e69d62017-10-24 14:04:46 -0500107FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500108
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500109FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500110SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}"
Matt Spinlerdd7a0802017-05-01 14:29:20 -0500111SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barthcac2ecf2017-08-23 13:18:01 -0500112SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wymanc50a8c42017-04-28 18:26:45 -0500113
114# --------------------------------------
115# phosphor-cooling-type specific configuration
Brad Bishop4785fdf2017-07-30 21:25:23 -0400116PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,,"