summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tung <tomtung@google.com>2021-08-06 09:19:14 +0300
committerTom Tung <shes050117@gmail.com>2021-08-10 08:18:12 +0300
commit48ea66bf4889bc86f19c9da78c342d2f18dbbabc (patch)
treec74537122a4d53c5972a3e1d36ba08a03c881de4
parent837dff3c80eee0d1b57260a55a6e3bd1de5ba578 (diff)
downloadopenbmc-48ea66bf4889bc86f19c9da78c342d2f18dbbabc.tar.xz
meta-google: host-power-ctrl: Import gpio-host-pwr from gBMC
Upstream common package for gpio-host-pwr. Change-Id: I08550d46d2b062f6b793cb5417d26231c7e4ca20 Signed-off-by: Tom Tung <shes050117@gmail.com>
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-ensure-off.service11
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle-watchdog.service7
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle.service6
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff-watchdog.service7
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff.service6
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweron.service10
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold-watchdog.service7
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold.service6
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm-watchdog.service7
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm.service6
-rwxr-xr-xmeta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_ensure_off.sh22
-rwxr-xr-xmeta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_isoff.sh21
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_powercycle.sh24
-rwxr-xr-xmeta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweroff.sh65
-rwxr-xr-xmeta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweron.sh65
-rwxr-xr-xmeta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_reset.sh39
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/lib.sh69
-rw-r--r--meta-google/recipes-google/host-power-ctrl/gpio-host-pwr_git.bb57
18 files changed, 435 insertions, 0 deletions
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-ensure-off.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-ensure-off.service
new file mode 100644
index 000000000..96c6d20df
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-ensure-off.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Ensure host is off on clean AC cycle
+Before=host-poweron.service
+Before=firmware-updates-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host_ensure_off.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle-watchdog.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle-watchdog.service
new file mode 100644
index 000000000..1b1236e9e
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle-watchdog.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Powercycle host
+
+[Service]
+Type=oneshot
+Environment=DONT_STOP_WATCHDOG=1
+ExecStart=/usr/bin/host_powercycle.sh
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle.service
new file mode 100644
index 000000000..7ff2244d8
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-powercycle.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Powercycle host
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host_powercycle.sh
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff-watchdog.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff-watchdog.service
new file mode 100644
index 000000000..175dd1f08
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff-watchdog.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power off host
+
+[Service]
+Type=oneshot
+Environment=DONT_STOP_WATCHDOG=1
+ExecStart=/usr/bin/host_poweroff.sh
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff.service
new file mode 100644
index 000000000..803e01082
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweroff.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Power off host
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host_poweroff.sh
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweron.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweron.service
new file mode 100644
index 000000000..1837248fd
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-poweron.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Power on host
+After=firmware-updates.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host_poweron.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold-watchdog.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold-watchdog.service
new file mode 100644
index 000000000..d60872c15
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold-watchdog.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Cold Reset Host
+
+[Service]
+Type=oneshot
+Environment=DONT_STOP_WATCHDOG=1
+ExecStart=/usr/bin/host_reset.sh cold
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold.service
new file mode 100644
index 000000000..a014350a9
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-cold.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Cold Reset Host
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host_reset.sh cold
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm-watchdog.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm-watchdog.service
new file mode 100644
index 000000000..374380ec9
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm-watchdog.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Warm Reset Host
+
+[Service]
+Type=oneshot
+Environment=DONT_STOP_WATCHDOG=1
+ExecStart=/usr/bin/host_reset.sh warm
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm.service b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm.service
new file mode 100644
index 000000000..2dd4a26fc
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host-reset-warm.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Warm Reset Host
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host_reset.sh warm
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_ensure_off.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_ensure_off.sh
new file mode 100755
index 000000000..ab9f4726d
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_ensure_off.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if ! was_ac_reset.sh; then
+ echo "Not a tray reset, ignoring" >&2
+ exit 0
+fi
+
+echo "Powering off the host" >&2
+host_poweroff.sh
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_isoff.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_isoff.sh
new file mode 100755
index 000000000..459eca7e2
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_isoff.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source /usr/share/gpio-host-pwr/lib.sh || exit
+
+gpio_build_cache 10 "$HOST_GPIO_PGOOD" || return 255
+pgood="$(gpio_get_value "$HOST_GPIO_PGOOD")" || return 255
+echo "HOST_PGOOD=$pgood" >&2
+(( pgood == 0 ))
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_powercycle.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_powercycle.sh
new file mode 100644
index 000000000..3c8f00259
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_powercycle.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source /usr/share/gpio-host-pwr/lib.sh || exit
+gpio_build_cache 10 "$HOST_GPIO_PGOOD" "$HOST_GPIO_PWR_BTN" || exit
+
+rc=0
+host_poweroff.sh || rc=$?
+# We want to ensure we aren't too quickly bouncing the power button
+sleep 0.5
+host_poweron.sh || rc=$?
+exit $rc
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweroff.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweroff.sh
new file mode 100755
index 000000000..58c1da856
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweroff.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source /usr/share/gpio-host-pwr/lib.sh || exit
+
+gpio_build_cache 10 "$HOST_GPIO_PGOOD" "$HOST_GPIO_PWR_BTN" || exit
+gpio_init "$HOST_GPIO_PGOOD" || exit
+
+# Set the power status LED
+if [ -n "$HOST_LED_PWR" ]; then
+ echo 'none' > /sys/class/leds/"$HOST_LED_PWR"/trigger || true
+ echo '0' > /sys/class/leds/"$HOST_LED_PWR"/brightness || true
+fi
+
+# Ensure the watchdog is no longer going to run
+host_pwr_stop_watchdog || true
+
+# We don't want to do anything if the machine is already off
+pgood="$(gpio_get_value "$HOST_GPIO_PGOOD")" || exit
+if (( pgood == 0 )); then
+ echo 'Host is already off, doing nothing' >&2
+ exit 0
+fi
+
+# Do a long push of the button if PGOOD
+echo 'Stopping host power' >&2
+rc=0
+gpio_set_value "$HOST_GPIO_PWR_BTN" 1 || rc=$?
+
+# Loop until we realize that host power is off
+# Limit the loop count to 10 seconds as we should never
+# have to wait this long for poweroff
+s=$SECONDS
+while true; do
+ if ! pgood="$(gpio_get_value "$HOST_GPIO_PGOOD")"; then
+ rc=1
+ break
+ fi
+ if (( pgood == 0 )); then
+ echo 'Host is now off' >&2
+ break
+ fi
+ if (( SECONDS - s > 10 )); then
+ echo 'Poweroff timed out, terminating' >&2
+ rc=2
+ break
+ fi
+ sleep 0.1
+done
+
+gpio_set_value "$HOST_GPIO_PWR_BTN" 0 || rc=$?
+
+exit $rc
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweron.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweron.sh
new file mode 100755
index 000000000..2e6eb0217
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweron.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source /usr/share/gpio-host-pwr/lib.sh || exit
+
+gpio_build_cache 10 "$HOST_GPIO_PGOOD" "$HOST_GPIO_PWR_BTN" || exit
+gpio_init "$HOST_GPIO_PGOOD" || exit
+
+# Set the power status LED
+if [ -n "$HOST_LED_PWR" ]; then
+ echo 'none' > /sys/class/leds/"$HOST_LED_PWR"/trigger || true
+ echo '255' > /sys/class/leds/"$HOST_LED_PWR"/brightness || true
+fi
+
+# Ensure the watchdog is available before the host starts
+host_pwr_start_watchdog || true
+
+# We don't want to do anything if the machine is already on
+pgood="$(gpio_get_value "$HOST_GPIO_PGOOD")" || exit
+if (( pgood == 1 )); then
+ echo 'Host is already running, doing nothing' >&2
+ exit 0
+fi
+
+# Do a quick push of the button if PGOOD
+echo "Starting host power" >&2
+rc=0
+gpio_set_value "$HOST_GPIO_PWR_BTN" 1 || rc=$?
+sleep 0.1
+gpio_set_value "$HOST_GPIO_PWR_BTN" 0 || rc=$?
+
+# Loop until we realize that host power is on
+# Limit the loop count to 10 seconds as we should never
+# have to wait this long for poweroff
+s=$SECONDS
+while true; do
+ if ! pgood="$(gpio_get_value "$HOST_GPIO_PGOOD")"; then
+ rc=1
+ break
+ fi
+ if (( pgood == 1 )); then
+ echo 'Host is now on' >&2
+ break
+ fi
+ if (( SECONDS - s > 10 )); then
+ echo 'Poweron timed out, terminating' >&2
+ rc=2
+ break
+ fi
+ sleep 0.1
+done
+
+exit $rc
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_reset.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_reset.sh
new file mode 100755
index 000000000..2f48a1240
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_reset.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source /usr/share/gpio-host-pwr/lib.sh || exit
+
+if [[ "${1-}" == "warm" ]]; then
+ rst_txt='WARM' >&2
+ rst_gpio="$HOST_GPIO_WARM_RESET"
+else
+ rst_txt='COLD' >&2
+ rst_gpio="$HOST_GPIO_COLD_RESET"
+fi
+
+gpio_build_cache 10 "$rst_gpio" || exit
+
+# Do a quick push of the button if PGOOD
+echo "Issuing $rst_txt reset" >&2
+rc=0
+gpio_set_value "$rst_gpio" 1 || rc=$?
+sleep 0.1
+gpio_set_value "$rst_gpio" 0 || rc=$?
+
+# Make sure the watchdog is stopped while the host is in reset
+# and can't possibly restart it.
+host_pwr_stop_watchdog || true
+
+exit $rc
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/lib.sh b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/lib.sh
new file mode 100644
index 000000000..16b36a58b
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/lib.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This is intended to be used as a library for managing gpio line values.
+# Executing this directly will do nothing.
+[ -n "${host_pwr_init-}" ] && return
+
+source /usr/share/gpio-ctrl/lib.sh || exit
+
+# Read by the tooling to determine if the machine is powered on or off
+HOST_GPIO_PGOOD='unset'
+# Set according to whether the host is powered on or off
+HOST_LED_PWR=''
+# Written by the tooling to assert the power button
+HOST_GPIO_PWR_BTN='unset'
+# Written by the tooling to assert a cold reset
+HOST_GPIO_COLD_RESET='unset'
+# Written by the tooling to assert a warm reset
+HOST_GPIO_WARM_RESET='unset'
+
+# Load configurations from a known location in the filesystem to populate
+# named GPIOs
+shopt -s nullglob
+for conf in /usr/share/gpio-host-pwr/conf.d/*.sh; do
+ source "$conf"
+done
+
+##################################################
+# Stop the host watchdog
+# Return:
+# 0 if success, non-zero if error
+##################################################
+host_pwr_stop_watchdog() {
+ # Check to see if we can stop the watchdog safely
+ # We don't want to stop if we are called from the watchdog itself
+ if [ -n "${DONT_STOP_WATCHDOG-}" ]; then
+ return 0
+ fi
+
+ echo 'Stopping the host watchdog' >&2
+ systemctl stop phosphor-watchdog@host0
+}
+
+##################################################
+# Start the host watchdog
+# Return:
+# 0 if success, non-zero if error
+##################################################
+host_pwr_start_watchdog() {
+ echo 'Starting the host watchdog' >&2
+ systemctl start phosphor-watchdog@host0
+}
+
+host_pwr_init=1
+return 0 2>/dev/null
+echo "gpio-host-pwr is a library, not executed directly" >&2
+exit 1
diff --git a/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr_git.bb b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr_git.bb
new file mode 100644
index 000000000..b2eee79d5
--- /dev/null
+++ b/meta-google/recipes-google/host-power-ctrl/gpio-host-pwr_git.bb
@@ -0,0 +1,57 @@
+SUMMARY = "GPIO based powercontrol for a host system"
+DESCRIPTION = "GPIO based powercontrol for a host system."
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit systemd
+
+RDEPENDS_${PN} += " \
+ bash \
+ gpio-ctrl \
+ "
+
+SRC_URI += " \
+ file://host-ensure-off.service \
+ file://host-powercycle-watchdog.service \
+ file://host-powercycle.service \
+ file://host-poweroff-watchdog.service \
+ file://host-poweroff.service \
+ file://host-poweron.service \
+ file://host-reset-cold-watchdog.service \
+ file://host-reset-cold.service \
+ file://host-reset-warm-watchdog.service \
+ file://host-reset-warm.service \
+ file://host_ensure_off.sh \
+ file://host_isoff.sh \
+ file://host_powercycle.sh \
+ file://host_poweroff.sh \
+ file://host_poweron.sh \
+ file://host_reset.sh \
+ file://lib.sh \
+ "
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} += " \
+ host-reset-cold.service \
+ host-reset-cold-watchdog.service \
+ host-reset-warm.service \
+ host-reset-warm-watchdog.service \
+ host-ensure-off.service \
+ host-powercycle.service \
+ host-powercycle-watchdog.service \
+ host-poweroff.service \
+ host-poweroff-watchdog.service \
+ host-poweron.service \
+ "
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/host_*.sh ${D}${bindir}/
+
+ install -d ${D}${datadir}/gpio-host-pwr
+ install -m 0755 ${WORKDIR}/lib.sh ${D}${datadir}/gpio-host-pwr/
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/
+}