summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb')
-rw-r--r--meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb82
1 files changed, 16 insertions, 66 deletions
diff --git a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
index e7c3cc160..5c4b6a012 100644
--- a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
+++ b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
@@ -7,79 +7,29 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7ca
inherit systemd
inherit obmc-phosphor-systemd
-# For now, monitoring shutdown_ack and reboot_ack are the only usecases
-OBMC_HOST_MONITOR_INSTANCES = "shutdown_ack reboot_ack"
-SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/shutdown_ack obmc/gpio/reboot_ack"
-
S = "${WORKDIR}"
-SRC_URI = "file://ampere-host-shutdown.service \
- file://ampere-host-reset.service \
- file://ampere_power_util.sh \
- file://ampere-chassis-poweroff.service \
- file://ampere-chassis-poweron.service \
- file://ampere-host-reset-ack.service \
- file://ampere-host-force-reset.service \
- file://ampere-host-power-cycle.service \
+SRC_URI = " \
+ file://ampere-host-force-reset@.service \
+ file://ampere-host-on-host-check@.service \
"
-DEPENDS = "systemd virtual/obmc-gpio-monitor"
-RDEPENDS_${PN} = "bash virtual/obmc-gpio-monitor"
-
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = " \
- ampere-host-shutdown.service \
- ampere-host-reset.service \
- ampere-chassis-poweroff.service \
- ampere-chassis-poweron.service \
- ampere-host-reset-ack.service \
- ampere-host-force-reset.service \
- ampere-host-power-cycle.service \
+ ampere-host-force-reset@.service \
"
-# host power control
-# overwrite the host shutdown to graceful shutdown
-HOST_SHUTDOWN_TMPL = "ampere-host-shutdown.service"
-HOST_SHUTDOWN_TGTFMT = "obmc-host-shutdown@{0}.target"
-HOST_SHUTDOWN_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_SHUTDOWN_TGTFMT}.requires/${HOST_SHUTDOWN_TMPL}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_SHUTDOWN_FMT', 'OBMC_HOST_INSTANCES')}"
-
-# Force the power cycle target to run the ampere power cycle
-HOST_REBOOT_SVC = "ampere-host-power-cycle.service"
-HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target"
-HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_SVC_TGTFMT}.requires/${HOST_REBOOT_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
-# overwrite the host reset to graceful reset
-HOST_WARM_REBOOT_SOFT_SVC = "ampere-host-reset.service"
-HOST_WARM_REBOOT_TGTFMT = "obmc-host-warm-reboot@{0}.target"
-HOST_WARM_REBOOT_SOFT_SVC_FMT = "../${HOST_WARM_REBOOT_SOFT_SVC}:${HOST_WARM_REBOOT_TGTFMT}.requires/${HOST_WARM_REBOOT_SOFT_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_SOFT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
-
-# overwrite force reboot
-HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset.service"
+# append force reboot
+HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset@.service"
+HOST_WARM_REBOOT_FORCE_INSTMPL = "ampere-host-force-reset@{0}.service"
HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
-HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}"
+HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_INSTMPL}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
-
-# chassis power control
-CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service"
-CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
-CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
-
-CHASSIS_POWEROFF_SVC = "ampere-chassis-poweroff.service"
-CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target"
-CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
-
-TMPL = "phosphor-gpio-monitor@.service"
-INSTFMT = "phosphor-gpio-monitor@{0}.service"
-TGT = "multi-user.target"
-FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}"
-
-do_install() {
- install -d ${D}/usr/sbin
- install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh
-}
-
+SYSTEMD_SERVICE_${PN} += "${HOST_WARM_REBOOT_FORCE_TGT}"
+
+HOST_ON_RESET_HOSTTMPL = "ampere-host-on-host-check@.service"
+HOST_ON_RESET_HOSTINSTMPL = "ampere-host-on-host-check@{0}.service"
+HOST_ON_RESET_HOSTTGTFMT = "obmc-host-startmin@{0}.target"
+HOST_ON_RESET_HOSTFMT = "../${HOST_ON_RESET_HOSTTMPL}:${HOST_ON_RESET_HOSTTGTFMT}.requires/${HOST_ON_RESET_HOSTINSTMPL}"
+SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_ON_RESET_HOSTFMT', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_SERVICE_${PN} += "${HOST_ON_RESET_HOSTTMPL}"