blob: 54c14d491d2638d6400420a7c27054cb89ca0312 [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
Thang Q. Nguyend57a5fb2022-02-18 05:57:04 +000010RDEPENDS:${PN} = "bash"
Tung Nguyen8f221bf2020-12-16 05:52:18 +000011S = "${WORKDIR}"
12
ThuBaNguyen98f43be2021-07-01 22:29:49 +070013SRC_URI = " \
Thang Q. Nguyend57a5fb2022-02-18 05:57:04 +000014 file://ampere-host-force-reset@.service \
15 file://ampere-host-on-host-check@.service \
16 file://ampere_host_check.sh \
Thu Nguyen6c188d62022-08-29 09:46:09 +070017 file://obmc-power-already-on@.target \
18 file://obmc-host-already-on@.target \
19 file://ampere-bmc-reboot-host-check@.service \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000020 "
21
Tung Nguyen8f221bf2020-12-16 05:52:18 +000022SYSTEMD_PACKAGES = "${PN}"
Thang Q. Nguyenfa1aa4d2021-08-07 05:09:50 +000023SYSTEMD_SERVICE:${PN} = " \
Thang Q. Nguyend57a5fb2022-02-18 05:57:04 +000024 ampere-host-force-reset@.service \
Thu Nguyen6c188d62022-08-29 09:46:09 +070025 obmc-power-already-on@.target \
26 obmc-host-already-on@.target \
27 ampere-bmc-reboot-host-check@.service \
Thang Q. Nguyend57a5fb2022-02-18 05:57:04 +000028 "
Tung Nguyen8f221bf2020-12-16 05:52:18 +000029
ThuBaNguyenfb214782021-07-08 14:20:43 +070030# append force reboot
ThuBaNguyen2f952142021-07-05 13:32:26 +070031HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset@.service"
ThuBaNguyenfb214782021-07-08 14:20:43 +070032HOST_WARM_REBOOT_FORCE_INSTMPL = "ampere-host-force-reset@{0}.service"
Tung Nguyen8f221bf2020-12-16 05:52:18 +000033HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
ThuBaNguyenfb214782021-07-08 14:20:43 +070034HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_INSTMPL}"
Patrick Williamse83c2202021-09-01 16:17:33 -050035SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
Thang Q. Nguyenfa1aa4d2021-08-07 05:09:50 +000036SYSTEMD_SERVICE:${PN} += "${HOST_WARM_REBOOT_FORCE_TGT}"
Tung Nguyen8f221bf2020-12-16 05:52:18 +000037
ThuBaNguyen7b452822021-06-06 14:36:07 +070038HOST_ON_RESET_HOSTTMPL = "ampere-host-on-host-check@.service"
39HOST_ON_RESET_HOSTINSTMPL = "ampere-host-on-host-check@{0}.service"
40HOST_ON_RESET_HOSTTGTFMT = "obmc-host-startmin@{0}.target"
41HOST_ON_RESET_HOSTFMT = "../${HOST_ON_RESET_HOSTTMPL}:${HOST_ON_RESET_HOSTTGTFMT}.requires/${HOST_ON_RESET_HOSTINSTMPL}"
Patrick Williamse83c2202021-09-01 16:17:33 -050042SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_ON_RESET_HOSTFMT', 'OBMC_HOST_INSTANCES')}"
Thang Q. Nguyenfa1aa4d2021-08-07 05:09:50 +000043SYSTEMD_SERVICE:${PN} += "${HOST_ON_RESET_HOSTTMPL}"
Thang Q. Nguyend57a5fb2022-02-18 05:57:04 +000044
Thang Q. Nguyenfa06f1f2022-12-09 09:03:53 +070045# append on phosphor-wait-power-on
Thu Nguyen6c188d62022-08-29 09:46:09 +070046AMPERE_POWER_ON_TGT = "obmc-power-already-on@.target"
47AMPERE_POWER_ON_INSTMPL = "obmc-power-already-on@{0}.target"
Thang Q. Nguyenfa06f1f2022-12-09 09:03:53 +070048OP_WAIT_POWER_ON = "phosphor-wait-power-on@{0}.service"
Thu Nguyen6c188d62022-08-29 09:46:09 +070049AMPERE_POWER_ON_TARGET_FMT = "../${AMPERE_POWER_ON_TGT}:${OP_WAIT_POWER_ON}.wants/${AMPERE_POWER_ON_INSTMPL}"
50SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'AMPERE_POWER_ON_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
51
52# append on obmc-chassis-poweron but will start after phosphor-state-manager init
53# host state as running
54HOST_CHECK_BMC_REBOOT_HOSTTMPL = "ampere-bmc-reboot-host-check@.service"
55HOST_CHECK_BMC_REBOOT_HOSTINSTMPL = "ampere-bmc-reboot-host-check@{0}.service"
56HOST_CHECK_BMC_REBOOT_HOSTTGTFMT = "obmc-chassis-poweron@{0}.target"
57HOST_CHECK_BMC_REBOOT_HOSTFMT = "../${HOST_CHECK_BMC_REBOOT_HOSTTMPL}:${HOST_CHECK_BMC_REBOOT_HOSTTGTFMT}.requires/${HOST_CHECK_BMC_REBOOT_HOSTINSTMPL}"
58SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_CHECK_BMC_REBOOT_HOSTFMT', 'OBMC_HOST_INSTANCES')}"
59
Thang Q. Nguyend57a5fb2022-02-18 05:57:04 +000060do_install() {
61 install -d ${D}/usr/sbin
62 install -m 0755 ${WORKDIR}/ampere_host_check.sh ${D}/${sbindir}/
63}