blob: 5408b4750bfe9fe3beeb6992a343dd262f03d676 [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 \
Patrick Williams267c0bb2017-01-19 21:20:46 -060018"
Brad Bishopf6f49d52018-04-11 11:44:15 -040019PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}"
20ALLOW_EMPTY_${PN} = "1"
Brad Bishopc3f10572017-03-01 16:08:45 -050021
Patrick Williams267c0bb2017-01-19 21:20:46 -060022DBUS_PACKAGES = "${STATE_MGR_PACKAGES}"
23
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060024SYSTEMD_PACKAGES = "${PN}-discover \
25 ${PN}-reset-sensor-states \
26"
Andrew Geissler7a4341e2018-03-13 11:46:27 -070027
28# The host-check function will check if the host is running
29# after a BMC reset.
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060030# The reset-sensor-states function will reset the host
Andrew Geissler7a4341e2018-03-13 11:46:27 -070031# sensors on a BMC reset or system power loss.
32# Neither is required for host state function but are
33# recommended to deal properly with these reset scenarios.
34RRECOMMENDS_${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states"
Patrick Williams267c0bb2017-01-19 21:20:46 -060035
36inherit autotools pkgconfig
37inherit obmc-phosphor-dbus-service
38
39DEPENDS += "autoconf-archive-native"
40DEPENDS += "sdbusplus"
William A. Kennington IIIf0e66742018-10-18 01:34:43 -070041DEPENDS += "sdeventplus"
Patrick Williams267c0bb2017-01-19 21:20:46 -060042DEPENDS += "phosphor-logging"
Patrick Williamsd0486d82017-01-30 11:06:16 -060043DEPENDS += "phosphor-dbus-interfaces"
Brad Bishop26873c92019-03-22 23:41:42 -040044DEPENDS += "systemd"
Brad Bishopcc51cd92018-10-18 17:07:53 -040045DEPENDS += "libcereal"
Patrick Williams267c0bb2017-01-19 21:20:46 -060046
Patrick Williams267c0bb2017-01-19 21:20:46 -060047FILES_${PN}-host = "${sbindir}/phosphor-host-state-manager"
48DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service"
Andrew Geisslercd2b9462017-07-26 17:53:04 -050049DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service"
Lei YU5ae34a52018-08-01 14:02:26 +080050SYSTEMD_ENVIRONMENT_FILE_${PN}-host += "obmc/phosphor-reboot-host/reboot.conf"
Andrew Geissler22957e82018-03-27 19:39:05 -070051SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service"
Patrick Williams267c0bb2017-01-19 21:20:46 -060052
Patrick Williams267c0bb2017-01-19 21:20:46 -060053FILES_${PN}-chassis = "${sbindir}/phosphor-chassis-state-manager"
54DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service"
55
Josh Kinga9462882017-01-19 14:04:03 -060056FILES_${PN}-bmc = "${sbindir}/phosphor-bmc-state-manager"
57DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
58
Michael Tritz7199d262017-04-18 17:01:12 -050059FILES_${PN}-discover = "${sbindir}/phosphor-discover-system-state"
Michael Tritz1f792e02017-03-31 12:04:32 -050060SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service"
61
Andrew Geisslera94faf42017-05-08 15:58:01 -050062FILES_${PN}-host-check = "${sbindir}/phosphor-host-check"
63SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service"
64SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service"
65
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060066SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service"
67
Andrew Geisslera94faf42017-05-08 15:58:01 -050068RESET_CHECK_TMPL = "phosphor-reset-host-check@.service"
69RESET_CHECK_TGTFMT = "obmc-host-reset@{1}.target"
70RESET_CHECK_INSTFMT = "phosphor-reset-host-check@{0}.service"
71RESET_CHECK_FMT = "../${RESET_CHECK_TMPL}:${RESET_CHECK_TGTFMT}.requires/${RESET_CHECK_INSTFMT}"
72
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060073SENSOR_RESET_TMPL = "phosphor-reset-sensor-states@.service"
74SENSOR_RESET_TGTFMT = "obmc-host-reset@{1}.target"
75SENSOR_RESET_INSTFMT = "phosphor-reset-sensor-states@{0}.service"
76SENSOR_RESET_FMT = "../${SENSOR_RESET_TMPL}:${SENSOR_RESET_TGTFMT}.requires/${SENSOR_RESET_INSTFMT}"
77
Andrew Geisslera94faf42017-05-08 15:58:01 -050078RESET_RUNNING_TMPL = "phosphor-reset-host-running@.service"
79RESET_RUNNING_TGTFMT = "obmc-host-reset@{1}.target"
80RESET_RUNNING_INSTFMT = "phosphor-reset-host-running@{0}.service"
81RESET_RUNNING_FMT = "../${RESET_RUNNING_TMPL}:${RESET_RUNNING_TGTFMT}.requires/${RESET_RUNNING_INSTFMT}"
82
83SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_CHECK_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
84SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_RUNNING_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
85
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060086SYSTEMD_LINK_${PN}-reset-sensor-states += "${@compose_list_zip(d, 'SENSOR_RESET_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
87
Andrew Geisslera94faf42017-05-08 15:58:01 -050088# Force the standby target to run the host reset check target
89RESET_TMPL_CTRL = "obmc-host-reset@.target"
90SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}"
91RESET_INSTFMT_CTRL = "obmc-host-reset@{0}.target"
92RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}"
93SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_HOST_INSTANCES')}"
94
Michael Tritz1f792e02017-03-31 12:04:32 -050095TMPL = "phosphor-discover-system-state@.service"
96INSTFMT = "phosphor-discover-system-state@{0}.service"
97FMT = "../${TMPL}:${SYSTEMD_DEFAULT_TARGET}.wants/${INSTFMT}"
98SYSTEMD_LINK_${PN}-discover += "${@compose_list(d, 'FMT', 'OBMC_HOST_INSTANCES')}"
Michael Tritz7199d262017-04-18 17:01:12 -050099
Andrew Geissler4a0f3322017-07-20 10:28:34 -0500100# Force the shutdown target to run the chassis-poweroff target
101CHASSIS_STOP_TMPL = "obmc-chassis-poweroff@.target"
Andrew Geissler191400b2017-05-26 17:40:03 -0500102HOST_STOP_TGTFMT = "obmc-host-shutdown@{1}.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -0500103CHASSIS_STOP_INSTFMT = "obmc-chassis-poweroff@{0}.target"
104HOST_STOP_FMT = "../${CHASSIS_STOP_TMPL}:${HOST_STOP_TGTFMT}.requires/${CHASSIS_STOP_INSTFMT}"
105SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_STOP_FMT', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler191400b2017-05-26 17:40:03 -0500106
Andrew Geisslercd2b9462017-07-26 17:53:04 -0500107# Force the host reboot target to run the shutdown target
108HOST_SHUTDOWN_TMPL = "obmc-host-shutdown@.target"
109HOST_REBOOT_TGTFMT = "obmc-host-reboot@{0}.target"
110HOST_SHUTDOWN_INSTFMT = "obmc-host-shutdown@{0}.target"
111HOST_REBOOT_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_REBOOT_TGTFMT}.requires/${HOST_SHUTDOWN_INSTFMT}"
112SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_FMT', 'OBMC_HOST_INSTANCES')}"
113
Andrew Geissler510ae372018-03-27 13:56:26 -0700114# And also force the reboot target to call the host startmin service
Andrew Geisslercd2b9462017-07-26 17:53:04 -0500115HOST_REBOOT_SVC = "phosphor-reboot-host@.service"
116HOST_REBOOT_SVC_INST = "phosphor-reboot-host@{0}.service"
117HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_TGTFMT}.requires/${HOST_REBOOT_SVC_INST}"
118SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
119
Andrew Geissler510ae372018-03-27 13:56:26 -0700120# Force the host-start target to call the host-startmin target
121HOST_STARTMIN_TMPL = "obmc-host-startmin@.target"
122HOST_START_TGTFMT = "obmc-host-start@{0}.target"
123HOST_STARTMIN_INSTFMT = "obmc-host-startmin@{0}.target"
124HOST_START_FMT = "../${HOST_STARTMIN_TMPL}:${HOST_START_TGTFMT}.requires/${HOST_STARTMIN_INSTFMT}"
125SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_START_FMT', 'OBMC_HOST_INSTANCES')}"
126
Andrew Geissler22957e82018-03-27 19:39:05 -0700127# Force the host-start target to call the reboot count reset service
128HOST_RST_RBT_ATTEMPTS_SVC = "phosphor-reset-host-reboot-attempts@.service"
129HOST_RST_RBT_ATTEMPTS_SVC_INST = "phosphor-reset-host-reboot-attempts@{0}.service"
130HOST_RST_RBT_ATTEMPTS_SVC_FMT = "../${HOST_RST_RBT_ATTEMPTS_SVC}:${HOST_START_TGTFMT}.requires/${HOST_RST_RBT_ATTEMPTS_SVC_INST}"
131SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_RST_RBT_ATTEMPTS_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
132
Patrick Williams267c0bb2017-01-19 21:20:46 -0600133SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
Andrew Geissler0f067192018-11-28 17:20:28 +0000134SRCREV = "32c532ea9bcddcab30f4fff30e6938211fdf584d"
Patrick Williams267c0bb2017-01-19 21:20:46 -0600135
136S = "${WORKDIR}/git"