blob: 461aeb5d4088900f511504c4f13e5a2b77c0041a [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 \
17 file://ampere-host-reset-ack.service \
18 file://ampere-host-force-reset.service \
19 file://ampere-host-power-cycle.service \
20 "
21
22DEPENDS = "systemd"
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050023RDEPENDS:${PN} = "bash"
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050024
25SYSTEMD_PACKAGES = "${PN}"
Mohaimen Alsamaraif59d0172021-08-17 09:34:22 -050026SYSTEMD_SERVICE:${PN} = " \
Mohaimen Alsamarai82a11d82021-06-24 16:59:29 -050027 ampere-host-shutdown.service \
28 ampere-host-reset.service \
29 ampere-chassis-poweroff.service \
30 ampere-chassis-poweron.service \
31 ampere-host-reset-ack.service \
32 ampere-host-force-reset.service \
33 ampere-host-power-cycle.service \
34 "
35# host power control
36# overwrite the host shutdown to graceful shutdown
37HOST_SHUTDOWN_TMPL = "ampere-host-shutdown.service"
38HOST_SHUTDOWN_TGTFMT = "obmc-host-shutdown@{0}.target"
39HOST_SHUTDOWN_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_SHUTDOWN_TGTFMT}.requires/${HOST_SHUTDOWN_TMPL}"
40SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_SHUTDOWN_FMT', 'OBMC_HOST_INSTANCES')}"
41
42# Force the power cycle target to run the ampere power cycle
43HOST_REBOOT_SVC = "ampere-host-power-cycle.service"
44HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target"
45HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_SVC_TGTFMT}.requires/${HOST_REBOOT_SVC}"
46SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
47
48# overwrite the host reset to graceful reset
49HOST_WARM_REBOOT_SOFT_SVC = "ampere-host-reset.service"
50HOST_WARM_REBOOT_TGTFMT = "obmc-host-warm-reboot@{0}.target"
51HOST_WARM_REBOOT_SOFT_SVC_FMT = "../${HOST_WARM_REBOOT_SOFT_SVC}:${HOST_WARM_REBOOT_TGTFMT}.requires/${HOST_WARM_REBOOT_SOFT_SVC}"
52SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_SOFT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
53
54# overwrite force reboot
55HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset.service"
56HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
57HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}"
58SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
59
60# chassis power control
61CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service"
62CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
63CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_SVC}"
64SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
65
66CHASSIS_POWEROFF_SVC = "ampere-chassis-poweroff.service"
67CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target"
68CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_SVC}"
69SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
70
71TMPL = "phosphor-gpio-monitor@.service"
72INSTFMT = "phosphor-gpio-monitor@{0}.service"
73TGT = "multi-user.target"
74FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
75SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}"
76
77do_install() {
78 install -d ${D}/usr/sbin
79 install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh
80}
81