blob: a1e23c3fab60ae10970879745b7b9b1506f6b8cf [file] [log] [blame]
Patrick Williams267c0bb2017-01-19 21:20:46 -06001SUMMARY = "Phosphor State Management"
2DESCRIPTION = "Phosphor State Manager provides a set of system state \
3management daemons. It is suitable for use on a wide variety of OpenBMC \
4platforms."
5HOMEPAGE = "https://github.com/openbmc/phosphor-state-manager"
6PR = "r1"
Patrick Venturee22ac6b2018-10-21 08:23:40 -07007PV = "1.0+git${SRCPV}"
Patrick Williams267c0bb2017-01-19 21:20:46 -06008LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
10
11STATE_MGR_PACKAGES = " \
12 ${PN}-host \
13 ${PN}-chassis \
Josh Kinga9462882017-01-19 14:04:03 -060014 ${PN}-bmc \
Michael Tritz7199d262017-04-18 17:01:12 -050015 ${PN}-discover \
Andrew Geisslera94faf42017-05-08 15:58:01 -050016 ${PN}-host-check \
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060017 ${PN}-reset-sensor-states \
Andrew Geisslerf26fd902019-09-23 19:11:20 +000018 ${PN}-systemd-target-monitor \
Patrick Williams267c0bb2017-01-19 21:20:46 -060019"
Brad Bishopf6f49d52018-04-11 11:44:15 -040020PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}"
21ALLOW_EMPTY_${PN} = "1"
Brad Bishopc3f10572017-03-01 16:08:45 -050022
Patrick Williams267c0bb2017-01-19 21:20:46 -060023DBUS_PACKAGES = "${STATE_MGR_PACKAGES}"
24
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060025SYSTEMD_PACKAGES = "${PN}-discover \
26 ${PN}-reset-sensor-states \
Andrew Geisslerf26fd902019-09-23 19:11:20 +000027 ${PN}-systemd-target-monitor \
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060028"
Andrew Geissler7a4341e2018-03-13 11:46:27 -070029
30# The host-check function will check if the host is running
31# after a BMC reset.
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060032# The reset-sensor-states function will reset the host
Andrew Geissler7a4341e2018-03-13 11:46:27 -070033# sensors on a BMC reset or system power loss.
34# Neither is required for host state function but are
35# recommended to deal properly with these reset scenarios.
36RRECOMMENDS_${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states"
Patrick Williams267c0bb2017-01-19 21:20:46 -060037
38inherit autotools pkgconfig
39inherit obmc-phosphor-dbus-service
40
41DEPENDS += "autoconf-archive-native"
42DEPENDS += "sdbusplus"
William A. Kennington IIIf0e66742018-10-18 01:34:43 -070043DEPENDS += "sdeventplus"
Patrick Williams267c0bb2017-01-19 21:20:46 -060044DEPENDS += "phosphor-logging"
Patrick Williamsd0486d82017-01-30 11:06:16 -060045DEPENDS += "phosphor-dbus-interfaces"
Brad Bishopcc51cd92018-10-18 17:07:53 -040046DEPENDS += "libcereal"
Andrew Geisslerf26fd902019-09-23 19:11:20 +000047DEPENDS += "nlohmann-json"
48DEPENDS += "cli11"
Patrick Williams267c0bb2017-01-19 21:20:46 -060049
Anthony Wilson3492fb92019-03-30 08:11:32 -070050FILES_${PN}-host = "${bindir}/phosphor-host-state-manager"
Patrick Williams267c0bb2017-01-19 21:20:46 -060051DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service"
Andrew Geisslercd2b9462017-07-26 17:53:04 -050052DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service"
Lei YU5ae34a52018-08-01 14:02:26 +080053SYSTEMD_ENVIRONMENT_FILE_${PN}-host += "obmc/phosphor-reboot-host/reboot.conf"
Andrew Geissler22957e82018-03-27 19:39:05 -070054SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service"
Patrick Williams267c0bb2017-01-19 21:20:46 -060055
Anthony Wilson3492fb92019-03-30 08:11:32 -070056FILES_${PN}-chassis = "${bindir}/phosphor-chassis-state-manager"
Patrick Williams267c0bb2017-01-19 21:20:46 -060057DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service"
58
Anthony Wilson3492fb92019-03-30 08:11:32 -070059FILES_${PN}-chassis += "${bindir}/obmcutil"
60
61FILES_${PN}-bmc = "${bindir}/phosphor-bmc-state-manager"
Josh Kinga9462882017-01-19 14:04:03 -060062DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
63
Anthony Wilson3492fb92019-03-30 08:11:32 -070064FILES_${PN}-discover = "${bindir}/phosphor-discover-system-state"
Michael Tritz1f792e02017-03-31 12:04:32 -050065SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service"
66
Anthony Wilson3492fb92019-03-30 08:11:32 -070067FILES_${PN}-host-check = "${bindir}/phosphor-host-check"
Andrew Geisslera94faf42017-05-08 15:58:01 -050068SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service"
69SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service"
70
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060071SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service"
72
Andrew Geisslerf26fd902019-09-23 19:11:20 +000073FILES_${PN}-systemd-target-monitor = " \
74 ${bindir}/phosphor-systemd-target-monitor \
75 ${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json \
76 "
77SYSTEMD_SERVICE_${PN}-systemd-target-monitor += "phosphor-systemd-target-monitor.service"
78
Andrew Geisslera94faf42017-05-08 15:58:01 -050079RESET_CHECK_TMPL = "phosphor-reset-host-check@.service"
80RESET_CHECK_TGTFMT = "obmc-host-reset@{1}.target"
81RESET_CHECK_INSTFMT = "phosphor-reset-host-check@{0}.service"
82RESET_CHECK_FMT = "../${RESET_CHECK_TMPL}:${RESET_CHECK_TGTFMT}.requires/${RESET_CHECK_INSTFMT}"
83
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060084SENSOR_RESET_TMPL = "phosphor-reset-sensor-states@.service"
85SENSOR_RESET_TGTFMT = "obmc-host-reset@{1}.target"
86SENSOR_RESET_INSTFMT = "phosphor-reset-sensor-states@{0}.service"
87SENSOR_RESET_FMT = "../${SENSOR_RESET_TMPL}:${SENSOR_RESET_TGTFMT}.requires/${SENSOR_RESET_INSTFMT}"
88
Andrew Geisslera94faf42017-05-08 15:58:01 -050089RESET_RUNNING_TMPL = "phosphor-reset-host-running@.service"
90RESET_RUNNING_TGTFMT = "obmc-host-reset@{1}.target"
91RESET_RUNNING_INSTFMT = "phosphor-reset-host-running@{0}.service"
92RESET_RUNNING_FMT = "../${RESET_RUNNING_TMPL}:${RESET_RUNNING_TGTFMT}.requires/${RESET_RUNNING_INSTFMT}"
93
94SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_CHECK_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
95SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_RUNNING_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
96
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060097SYSTEMD_LINK_${PN}-reset-sensor-states += "${@compose_list_zip(d, 'SENSOR_RESET_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
98
Andrew Geisslera94faf42017-05-08 15:58:01 -050099# Force the standby target to run the host reset check target
100RESET_TMPL_CTRL = "obmc-host-reset@.target"
Patrick Ventured607cfb2019-04-04 12:15:22 -0700101SYSD_TGT = "multi-user.target"
Andrew Geisslera94faf42017-05-08 15:58:01 -0500102RESET_INSTFMT_CTRL = "obmc-host-reset@{0}.target"
103RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}"
104SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_HOST_INSTANCES')}"
105
Michael Tritz1f792e02017-03-31 12:04:32 -0500106TMPL = "phosphor-discover-system-state@.service"
107INSTFMT = "phosphor-discover-system-state@{0}.service"
Patrick Ventured607cfb2019-04-04 12:15:22 -0700108FMT = "../${TMPL}:multi-user.target.wants/${INSTFMT}"
Michael Tritz1f792e02017-03-31 12:04:32 -0500109SYSTEMD_LINK_${PN}-discover += "${@compose_list(d, 'FMT', 'OBMC_HOST_INSTANCES')}"
Michael Tritz7199d262017-04-18 17:01:12 -0500110
Andrew Geissler4a0f3322017-07-20 10:28:34 -0500111# Force the shutdown target to run the chassis-poweroff target
112CHASSIS_STOP_TMPL = "obmc-chassis-poweroff@.target"
Andrew Geissler191400b2017-05-26 17:40:03 -0500113HOST_STOP_TGTFMT = "obmc-host-shutdown@{1}.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -0500114CHASSIS_STOP_INSTFMT = "obmc-chassis-poweroff@{0}.target"
115HOST_STOP_FMT = "../${CHASSIS_STOP_TMPL}:${HOST_STOP_TGTFMT}.requires/${CHASSIS_STOP_INSTFMT}"
116SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_STOP_FMT', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler191400b2017-05-26 17:40:03 -0500117
Andrew Geisslercd2b9462017-07-26 17:53:04 -0500118# Force the host reboot target to run the shutdown target
119HOST_SHUTDOWN_TMPL = "obmc-host-shutdown@.target"
120HOST_REBOOT_TGTFMT = "obmc-host-reboot@{0}.target"
121HOST_SHUTDOWN_INSTFMT = "obmc-host-shutdown@{0}.target"
122HOST_REBOOT_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_REBOOT_TGTFMT}.requires/${HOST_SHUTDOWN_INSTFMT}"
123SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_FMT', 'OBMC_HOST_INSTANCES')}"
124
Andrew Geissler510ae372018-03-27 13:56:26 -0700125# And also force the reboot target to call the host startmin service
Andrew Geisslercd2b9462017-07-26 17:53:04 -0500126HOST_REBOOT_SVC = "phosphor-reboot-host@.service"
127HOST_REBOOT_SVC_INST = "phosphor-reboot-host@{0}.service"
128HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_TGTFMT}.requires/${HOST_REBOOT_SVC_INST}"
129SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
130
Andrew Geissler510ae372018-03-27 13:56:26 -0700131# Force the host-start target to call the host-startmin target
132HOST_STARTMIN_TMPL = "obmc-host-startmin@.target"
133HOST_START_TGTFMT = "obmc-host-start@{0}.target"
134HOST_STARTMIN_INSTFMT = "obmc-host-startmin@{0}.target"
135HOST_START_FMT = "../${HOST_STARTMIN_TMPL}:${HOST_START_TGTFMT}.requires/${HOST_STARTMIN_INSTFMT}"
136SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_START_FMT', 'OBMC_HOST_INSTANCES')}"
137
Andrew Geissler22957e82018-03-27 19:39:05 -0700138# Force the host-start target to call the reboot count reset service
139HOST_RST_RBT_ATTEMPTS_SVC = "phosphor-reset-host-reboot-attempts@.service"
140HOST_RST_RBT_ATTEMPTS_SVC_INST = "phosphor-reset-host-reboot-attempts@{0}.service"
141HOST_RST_RBT_ATTEMPTS_SVC_FMT = "../${HOST_RST_RBT_ATTEMPTS_SVC}:${HOST_START_TGTFMT}.requires/${HOST_RST_RBT_ATTEMPTS_SVC_INST}"
142SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_RST_RBT_ATTEMPTS_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
143
Andrew Geisslerf26fd902019-09-23 19:11:20 +0000144do_install_append() {
145 install -d ${D}${sysconfdir}/phosphor-systemd-target-monitor
146 install ${S}/phosphor-target-monitor-default.json ${D}${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json
147}
148
Patrick Williams267c0bb2017-01-19 21:20:46 -0600149SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
Andrew Geissler400b8922019-10-28 21:11:27 +0000150SRCREV = "2869a926212f596af6c87f883b7dd937878caf83"
Patrick Williams267c0bb2017-01-19 21:20:46 -0600151
152S = "${WORKDIR}/git"