Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 1 | SUMMARY = "Ampere Computing LLC Host Control Implementation" |
| 2 | DESCRIPTION = "A host control implementation suitable for Ampere Computing LLC's systems" |
| 3 | PR = "r1" |
| 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 6 | |
| 7 | inherit systemd |
| 8 | inherit obmc-phosphor-systemd |
| 9 | |
| 10 | # For now, monitoring shutdown_ack and reboot_ack are the only usecases |
| 11 | OBMC_HOST_MONITOR_INSTANCES = "shutdown_ack reboot_ack" |
| 12 | SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/shutdown_ack obmc/gpio/reboot_ack" |
| 13 | |
| 14 | S = "${WORKDIR}" |
| 15 | |
ThuBaNguyen | 98f43be | 2021-07-01 22:29:49 +0700 | [diff] [blame] | 16 | SRC_URI = " \ |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 17 | file://ampere_power_util.sh \ |
ThuBaNguyen | 2f95214 | 2021-07-05 13:32:26 +0700 | [diff] [blame^] | 18 | file://ampere-host-force-reset@.service \ |
| 19 | file://ampere-host-shutdown-ack@.service \ |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 20 | " |
| 21 | |
| 22 | DEPENDS = "systemd virtual/obmc-gpio-monitor" |
| 23 | RDEPENDS_${PN} = "bash virtual/obmc-gpio-monitor" |
| 24 | |
| 25 | SYSTEMD_PACKAGES = "${PN}" |
| 26 | SYSTEMD_SERVICE_${PN} = " \ |
ThuBaNguyen | 2f95214 | 2021-07-05 13:32:26 +0700 | [diff] [blame^] | 27 | ampere-host-force-reset@.service \ |
| 28 | ampere-host-shutdown-ack@.service \ |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 29 | " |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 30 | |
| 31 | # overwrite force reboot |
ThuBaNguyen | 2f95214 | 2021-07-05 13:32:26 +0700 | [diff] [blame^] | 32 | HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset@.service" |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 33 | HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target" |
| 34 | HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}" |
| 35 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}" |
| 36 | |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 37 | TMPL = "phosphor-gpio-monitor@.service" |
| 38 | INSTFMT = "phosphor-gpio-monitor@{0}.service" |
| 39 | TGT = "multi-user.target" |
| 40 | FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}" |
| 41 | SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}" |
| 42 | |
| 43 | do_install() { |
| 44 | install -d ${D}/usr/sbin |
| 45 | install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh |
| 46 | } |
| 47 | |