meta-ampere: power control: restructure source code
ampere-hostctrl package includes the generic codes and the platform
specific codes. The generic sources are applied for all of the Ampere
platforms, they are the service files and the scripts to setting the
GPIO pins. The platform specific sources are the GPIO pin config file
and the gpio monitor config files.
This commit moves the platform specific files to the platform code.
Tested:
1. Do the power control actions use ipmitool, BMC web and Redfish.
2. Make sure the server states are changed as expected.
Signed-off-by: ThuBaNguyen <thu@os.amperecomputing.com>
Change-Id: Ic0e261109f7a5dfaf38c883bff0afedab763a0b6
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 4a44d1b..cfefa8d 100644
--- a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
+++ b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
@@ -7,41 +7,21 @@
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_power_util.sh \
file://ampere-host-force-reset@.service \
- file://ampere-host-shutdown-ack@.service \
"
-DEPENDS = "systemd virtual/obmc-gpio-monitor"
-RDEPENDS_${PN} = "bash virtual/obmc-gpio-monitor"
-
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = " \
ampere-host-force-reset@.service \
- ampere-host-shutdown-ack@.service \
"
-# overwrite force reboot
+# 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')}"
-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
-}
-