blob: 4a44d1b2f0ab1c99268c09d07bf290f0b39f3377 [file] [log] [blame]
Tung Nguyen8f221bf2020-12-16 05:52:18 +00001SUMMARY = "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
10# For now, monitoring shutdown_ack and reboot_ack are the only usecases
11OBMC_HOST_MONITOR_INSTANCES = "shutdown_ack reboot_ack"
12SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/shutdown_ack obmc/gpio/reboot_ack"
13
14S = "${WORKDIR}"
15
ThuBaNguyen98f43be2021-07-01 22:29:49 +070016SRC_URI = " \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000017 file://ampere_power_util.sh \
ThuBaNguyen2f952142021-07-05 13:32:26 +070018 file://ampere-host-force-reset@.service \
19 file://ampere-host-shutdown-ack@.service \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000020 "
21
22DEPENDS = "systemd virtual/obmc-gpio-monitor"
23RDEPENDS_${PN} = "bash virtual/obmc-gpio-monitor"
24
25SYSTEMD_PACKAGES = "${PN}"
26SYSTEMD_SERVICE_${PN} = " \
ThuBaNguyen2f952142021-07-05 13:32:26 +070027 ampere-host-force-reset@.service \
28 ampere-host-shutdown-ack@.service \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000029 "
Tung Nguyen8f221bf2020-12-16 05:52:18 +000030
31# overwrite force reboot
ThuBaNguyen2f952142021-07-05 13:32:26 +070032HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset@.service"
Tung Nguyen8f221bf2020-12-16 05:52:18 +000033HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
34HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}"
35SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
36
Tung Nguyen8f221bf2020-12-16 05:52:18 +000037TMPL = "phosphor-gpio-monitor@.service"
38INSTFMT = "phosphor-gpio-monitor@{0}.service"
39TGT = "multi-user.target"
40FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
41SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}"
42
43do_install() {
44 install -d ${D}/usr/sbin
45 install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh
46}
47