blob: af026f75e12863c9b3c9992233420fcc834347b9 [file] [log] [blame]
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -05001SUMMARY = "Ampere Computing LLC Host Control Implementation"
2DESCRIPTION = "A host control implementation suitable for Ampere Computing LLC's systems"
3PR = "r1"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
6
7inherit systemd
8inherit obmc-phosphor-systemd
9
10S = "${WORKDIR}"
11
12SRC_URI = "file://ampere-host-shutdown.service \
13 file://ampere-host-reset.service \
14 file://ampere_power_util.sh \
15 file://ampere-chassis-poweroff.service \
16 file://ampere-chassis-poweron.service \
Charles Boyer17b216a2021-08-27 16:09:03 -050017 file://ampere-chassis-powercycle.service \
Charles Boyer1c51ca52021-08-24 11:25:03 -050018 file://ampere-host-shutdown-ack.service \
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050019 file://ampere-host-force-reset.service \
20 file://ampere-host-power-cycle.service \
21 "
22
23DEPENDS = "systemd"
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050024RDEPENDS:${PN} = "bash"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050025
26SYSTEMD_PACKAGES = "${PN}"
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050027SYSTEMD_SERVICE:${PN} = " \
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050028 ampere-host-shutdown.service \
29 ampere-host-reset.service \
30 ampere-chassis-poweroff.service \
31 ampere-chassis-poweron.service \
Charles Boyer17b216a2021-08-27 16:09:03 -050032 ampere-chassis-powercycle.service \
Charles Boyer1c51ca52021-08-24 11:25:03 -050033 ampere-host-shutdown-ack.service \
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050034 ampere-host-force-reset.service \
35 ampere-host-power-cycle.service \
36 "
37# host power control
38# overwrite the host shutdown to graceful shutdown
39HOST_SHUTDOWN_TMPL = "ampere-host-shutdown.service"
40HOST_SHUTDOWN_TGTFMT = "obmc-host-shutdown@{0}.target"
41HOST_SHUTDOWN_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_SHUTDOWN_TGTFMT}.requires/${HOST_SHUTDOWN_TMPL}"
Patrick Williamse83c2202021-09-01 16:17:33 -050042SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_SHUTDOWN_FMT', 'OBMC_HOST_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050043
44# Force the power cycle target to run the ampere power cycle
45HOST_REBOOT_SVC = "ampere-host-power-cycle.service"
46HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target"
47HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_SVC_TGTFMT}.requires/${HOST_REBOOT_SVC}"
Patrick Williamse83c2202021-09-01 16:17:33 -050048SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050049
50# overwrite the host reset to graceful reset
51HOST_WARM_REBOOT_SOFT_SVC = "ampere-host-reset.service"
52HOST_WARM_REBOOT_TGTFMT = "obmc-host-warm-reboot@{0}.target"
53HOST_WARM_REBOOT_SOFT_SVC_FMT = "../${HOST_WARM_REBOOT_SOFT_SVC}:${HOST_WARM_REBOOT_TGTFMT}.requires/${HOST_WARM_REBOOT_SOFT_SVC}"
Patrick Williamse83c2202021-09-01 16:17:33 -050054SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_SOFT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050055
56# overwrite force reboot
57HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset.service"
58HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
59HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050060SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050061
62# chassis power control
63CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service"
64CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
65CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_SVC}"
Patrick Williamse83c2202021-09-01 16:17:33 -050066SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050067
68CHASSIS_POWEROFF_SVC = "ampere-chassis-poweroff.service"
69CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target"
70CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_SVC}"
Patrick Williamse83c2202021-09-01 16:17:33 -050071SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050072
Charles Boyer17b216a2021-08-27 16:09:03 -050073CHASSIS_POWERCYCLE_SVC = "ampere-chassis-powercycle.service"
74CHASSIS_POWERCYCLE_TGTFMT = "obmc-chassis-powercycle@{0}.target"
75CHASSIS_POWERCYCLE_FMT = "../${CHASSIS_POWERCYCLE_SVC}:${CHASSIS_POWERCYCLE_TGTFMT}.requires/${CHASSIS_POWERCYCLE_SVC}"
Charles Boyer6e1b2182021-11-22 11:58:31 -060076SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERCYCLE_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Charles Boyer17b216a2021-08-27 16:09:03 -050077
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050078TMPL = "phosphor-gpio-monitor@.service"
79INSTFMT = "phosphor-gpio-monitor@{0}.service"
80TGT = "multi-user.target"
81FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050082SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050083
84do_install() {
85 install -d ${D}/usr/sbin
86 install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh
87}