diff options
author | jmbills <jason.m.bills@intel.com> | 2021-10-04 22:42:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 22:42:48 +0300 |
commit | 0c9e31989c615598b5d042ffab385606660c93c0 (patch) | |
tree | 8019999b0ca042482e5193d6cabc06220c71d776 /meta-google/recipes-google | |
parent | 04cd92067d2481643df5010cb39b2134b648cf4d (diff) | |
parent | ffe6d597d9e3d4407cf8062b5d6505a80ce08f41 (diff) | |
download | openbmc-0c9e31989c615598b5d042ffab385606660c93c0.tar.xz |
Update
Diffstat (limited to 'meta-google/recipes-google')
44 files changed, 827 insertions, 71 deletions
diff --git a/meta-google/recipes-google/acpi-power-state-daemon/acpi-power-state-daemon_git.bb b/meta-google/recipes-google/acpi-power-state-daemon/acpi-power-state-daemon_git.bb index 0755d4eab..0de07f93a 100644 --- a/meta-google/recipes-google/acpi-power-state-daemon/acpi-power-state-daemon_git.bb +++ b/meta-google/recipes-google/acpi-power-state-daemon/acpi-power-state-daemon_git.bb @@ -12,7 +12,7 @@ DEPENDS += " \ systemd \ " -SYSTEMD_SERVICE_${PN} = " \ +SYSTEMD_SERVICE:${PN} = " \ acpi-power-state.service \ host-s0-state.target \ host-s5-state.target \ diff --git a/meta-google/recipes-google/default-ca-dev/default-ca-dev.bb b/meta-google/recipes-google/default-ca-dev/default-ca-dev.bb index ecbb71267..3cce4cd46 100644 --- a/meta-google/recipes-google/default-ca-dev/default-ca-dev.bb +++ b/meta-google/recipes-google/default-ca-dev/default-ca-dev.bb @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5 SRC_URI += "file://certs/authority/" -FILES_${PN} = "${sysconfdir}/ssl/certs/authority/*" +FILES:${PN} = "${sysconfdir}/ssl/certs/authority/*" do_install(){ install -d ${D}${sysconfdir}/ssl/certs/authority diff --git a/meta-google/recipes-google/default-users/default-users.bb b/meta-google/recipes-google/default-users/default-users.bb index 76485ccd0..1dbf21577 100644 --- a/meta-google/recipes-google/default-users/default-users.bb +++ b/meta-google/recipes-google/default-users/default-users.bb @@ -8,16 +8,16 @@ EXCLUDE_FROM_WORLD = "1" DEPENDS = "bmcweb" DEPENDS += "phosphor-ipmi-host" DEPENDS += "phosphor-user-manager" -RDEPENDS_${PN} = "bmcweb" -RDEPENDS_${PN} += "phosphor-ipmi-host" -RDEPENDS_${PN} += "phosphor-user-manager" +RDEPENDS:${PN} = "bmcweb" +RDEPENDS:${PN} += "phosphor-ipmi-host" +RDEPENDS:${PN} += "phosphor-user-manager" inherit useradd USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} = "-m -N -u 1000 -g 100 -s /bin/nologin \ +USERADD_PARAM:${PN} = "-m -N -u 1000 -g 100 -s /bin/nologin \ -G 'web,redfish,priv-admin' Megapede; " -GROUPMEMS_PARAM_${PN} = "-g priv-admin -a root; " -GROUPMEMS_PARAM_${PN} += "-g ipmi -a root; " +GROUPMEMS_PARAM:${PN} = "-g priv-admin -a root; " +GROUPMEMS_PARAM:${PN} += "-g ipmi -a root; " -ALLOW_EMPTY_${PN} = "1" +ALLOW_EMPTY:${PN} = "1" diff --git a/meta-google/recipes-google/gpio/gpio-ctrl/lib.sh b/meta-google/recipes-google/gpio/gpio-ctrl/lib.sh new file mode 100644 index 000000000..a75c41306 --- /dev/null +++ b/meta-google/recipes-google/gpio/gpio-ctrl/lib.sh @@ -0,0 +1,250 @@ +#!/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 "${gpio_ctrl_init-}" ] && return + +# Map names of GPIOs to GPIO number +# This maps a schematic name to a gpiochip and line at a specific offset +declare -A GPIO_NAMES_TO_SCM=( + # Examples + #['SYS_RESET_N']='label=/pinctrl@f0800000/gpio@f0012000 21' + #['PWRBTN_N']='label=/pinctrl@f0800000/gpio@f0012000 23' + #['PCH_SLP_S5_R_N']='of_node=/ahb/apb/i2c@8e000/cpu_seq@6b 9' + #['PCH_PWRGOOD_R']='of_node=/ahb/apb/i2c@8e000/cpu_seq@6b 6' +) + +# Load configurations from a known location in the filesystem to populate +# named GPIOs +shopt -s nullglob +for conf in /usr/share/gpio-ctrl/conf.d/*.sh; do + source "$conf" +done + +declare -A gpio_sysfs_lookup_cache=() +declare -A gpio_lookup_cache=() + +declare -A gpio_init=() + +################################################## +# Looks up the sysfs GPIO number +# Arguments: +# $1: GPIO name +# Return: +# 0 if success, non-zero if error +# stdout: The GPIO number +################################################## +gpio_name_to_num() { + local name="$1" + + if [ -n "${gpio_lookup_cache["$name"]+1}" ]; then + echo "${gpio_lookup_cache["$name"]}" + return 0 + fi + + local scm="${GPIO_NAMES_TO_SCM["$name"]-}" + if [ -z "$scm" ]; then + echo "Missing gpio definition: $name" >&2 + return 1 + fi + local id="${scm% *}" + local type="${id%=*}" + local val="${id#*=}" + local offset="${scm#* }" + + local sysfs + if [ -n "${gpio_sysfs_lookup_cache["$id"]+1}" ]; then + sysfs="${gpio_sysfs_lookup_cache["$id"]}" + else + case "$type" in + label) + if ! sysfs="$(grep -xl "$val" /sys/class/gpio/gpiochip*/label)"; then + echo "Failed to find gpiochip: $val" >&2 + return 1 + fi + sysfs="${sysfs%/label}" + ;; + of_node) + for sysfs in $(echo /sys/class/gpio/gpiochip*); do + local link + # Ignore errors because not all devices have of_nodes + link="$(readlink -f "$sysfs/device/of_node" 2>/dev/null)" || continue + [ "${link#/sys/firmware/devicetree/base}" = "$val" ] && break + sysfs= + done + if [ -z "$sysfs" ]; then + echo "Failed to find gpiochip: $val" >&2 + return 1 + fi + ;; + *) + echo "Invalid GPIO type $type" >&2 + return 1 + ;; + esac + gpio_sysfs_lookup_cache["$id"]="$sysfs" + fi + + local ngpio=$(cat "$sysfs"/ngpio) + if (( ngpio <= offset )); then + echo "$name with gpiochip $sysfs only has $ngpio but wants $offset" >&2 + return 1 + fi + + gpio_lookup_cache["$name"]=$(( $(cat "$sysfs"/base) + offset )) + echo "${gpio_lookup_cache["$name"]}" +} + + +################################################## +# Populates the GPIO lookup cache +# Most calls to gpio_name_to_num that would +# normally cache the sysfs lookups for gpios run +# inside subshells. This prevents them from +# populating a global cache and greatly speeding +# up future lookups. This call allows scripts to +# populate the cache prior to looking up gpios. +################################################## +gpio_build_cache() { + local timeout="${1-0}" + shift + local gpios=("$@") + + if (( ${#gpios[@]} == 0 )); then + gpios="${!GPIO_NAMES_TO_SCM[@]}" + fi + + local deadline=$(( timeout + SECONDS )) + local name + for name in "${gpios[@]}"; do + while true; do + gpio_name_to_num "$name" >/dev/null && break + if (( deadline <= SECONDS )); then + echo "Timed out building gpio cache" >&2 + return 1 + fi + done + done +} + +################################################## +# Initializes the gpio state +# This operation is idempotent and can be applied +# repeatedly to the same gpio. It will make sure the +# gpio ends up in the initialized state even if it +# was. +# Arguments: +# $1: GPIO name +# Return: +# 0 if success, non-zero if error +################################################## +gpio_init_() { + local name="$1" + local num="$2" + + if [ -n "${gpio_init["$name"]+1}" ]; then + return 0 + fi + + if [ ! -e "/sys/class/gpio/gpio$num" ]; then + if ! echo "$num" >'/sys/class/gpio/export'; then + echo "Failed to export $name gpio$num" >&2 + return 1 + fi + fi + local active_low=0 + if [[ "${name%_N}" != "$name" ]]; then + active_low=1 + fi + if ! echo "$active_low" >"/sys/class/gpio/gpio$num/active_low"; then + echo "Failed to set active_low for $name gpio$num" >&2 + return 1 + fi + gpio_init["$name"]=1 +} +gpio_init() { + local name="$1" + + # Ensure the cache is updated by not running in a subshell + gpio_name_to_num "$name" >/dev/null || return + + gpio_init_ "$name" "$(gpio_name_to_num "$name")" +} + +################################################## +# Sets the output GPIO value. +# Arguments: +# $1: GPIO name +# $2: GPIO value, "1" or "0" +# Return: +# 0 if success, non-zero if error +################################################## +gpio_set_value_() { + local name="$1" + local num="$2" + local val="$3" + + gpio_init_ "$name" "$num" || return + if ! echo out >"/sys/class/gpio/gpio$num/direction"; then + echo "Failed to set output for $name gpio$num" >&2 + return 1 + fi + if ! echo "$val" >"/sys/class/gpio/gpio$num/value"; then + echo "Failed to set $name gpio$num = $val" >&2 + return 1 + fi +} +gpio_set_value() { + local name="$1" + local val="$2" + + # Ensure the cache is updated by not running in a subshell + gpio_name_to_num "$name" >/dev/null || return + + gpio_set_value_ "$name" "$(gpio_name_to_num "$name")" "$val" +} + +################################################## +# Get GPIO value +# Arguments: +# $1: GPIO name +# Return: +# 0 if success, non-zero if error +# stdout: The value of the gpio +################################################## +gpio_get_value_() { + local name="$1" + local num="$2" + + gpio_init_ "$name" "$num" || return + if ! cat "/sys/class/gpio/gpio$num/value"; then + echo "Failed to get $name gpio$num value" >&2 + return 1 + fi +} +gpio_get_value() { + local name="$1" + + # Ensure the cache is updated by not running in a subshell + gpio_name_to_num "$name" >/dev/null || return + + gpio_get_value_ "$name" "$(gpio_name_to_num "$name")" +} + +gpio_ctrl_init=1 +return 0 2>/dev/null +echo "gpio-ctrl is a library, not executed directly" >&2 +exit 1 diff --git a/meta-google/recipes-google/gpio/gpio-ctrl_git.bb b/meta-google/recipes-google/gpio/gpio-ctrl_git.bb new file mode 100644 index 000000000..c42b689ed --- /dev/null +++ b/meta-google/recipes-google/gpio/gpio-ctrl_git.bb @@ -0,0 +1,14 @@ +SUMMARY = "GPIO control library for bash scripts" +DESCRIPTION = "GPIO control library for bash scripts." +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" +PR = "r1" + +SRC_URI += "file://lib.sh" + +RDEPENDS:${PN} = "bash" + +do_install() { + install -d ${D}${datadir}/gpio-ctrl + install -m 0755 ${WORKDIR}/lib.sh ${D}${datadir}/gpio-ctrl/ +} 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..e63260c56 --- /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}/ +} diff --git a/meta-google/recipes-google/host-power-ctrl/libwatchdog/libwatchdog.sh b/meta-google/recipes-google/host-power-ctrl/libwatchdog/libwatchdog.sh new file mode 100644 index 000000000..dcb39692a --- /dev/null +++ b/meta-google/recipes-google/host-power-ctrl/libwatchdog/libwatchdog.sh @@ -0,0 +1,33 @@ +#!/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. + +################################################## +# Stop the host watchdog +# Return: +# 0 if success, non-zero if error +################################################## +stop_host_watchdog() { + if (( $# != 0 )); then + echo 'Usage: stop_host_watchdog' >&2 + return 1 + fi + + local srv='xyz.openbmc_project.Watchdog' + local obj='/xyz/openbmc_project/watchdog/host0' + local intf='xyz.openbmc_project.State.Watchdog' + local method='Enabled' + local args=('b' 'false') + busctl set-property "${srv}" "${obj}" "${intf}" "${method}" "${args[@]}" +} diff --git a/meta-google/recipes-google/host-power-ctrl/libwatchdog_git.bb b/meta-google/recipes-google/host-power-ctrl/libwatchdog_git.bb new file mode 100644 index 000000000..a9595c37c --- /dev/null +++ b/meta-google/recipes-google/host-power-ctrl/libwatchdog_git.bb @@ -0,0 +1,16 @@ +SUMMARY = "Watchdog Shell Library" +DESCRIPTION = "Watchdog Shell Library" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI += " \ + file://libwatchdog.sh \ +" + +RDEPENDS:${PN} = "bash" + +do_install() { + install -d ${D}${libexecdir} + install -m 0755 ${WORKDIR}/libwatchdog.sh ${D}${libexecdir}/ +} diff --git a/meta-google/recipes-google/ipmi/google-ipmi-i2c_git.bb b/meta-google/recipes-google/ipmi/google-ipmi-i2c_git.bb index aeba2a991..3d5504ea1 100644 --- a/meta-google/recipes-google/ipmi/google-ipmi-i2c_git.bb +++ b/meta-google/recipes-google/ipmi/google-ipmi-i2c_git.bb @@ -16,9 +16,9 @@ S = "${WORKDIR}/git" SRC_URI = "git://github.com/openbmc/google-ipmi-i2c" SRCREV = "b7d431199ac519e7c3cd5f3341d67f2ff0e09e10" -FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" -FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" -FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}" -FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" +FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}" +FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" HOSTIPMI_PROVIDER_LIBRARY += "libi2ccmds.so" diff --git a/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb b/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb index 801de4361..1310f7e00 100644 --- a/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb +++ b/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb @@ -21,15 +21,15 @@ S = "${WORKDIR}/git" SRC_URI = "git://github.com/openbmc/google-ipmi-sys" SRCREV = "b69209b498bf9b1c009c528e40280d13e68f8dbd" -FILES_${PN} += "${libdir}/ipmid-providers" +FILES:${PN} += "${libdir}/ipmid-providers" SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} += " \ +SYSTEMD_SERVICE:${PN} += " \ gbmc-host-poweroff.target \ gbmc-psu-hardreset.target \ " EXTRA_OEMESON += "-Dtests=disabled" -CXXFLAGS_append_gbmc = '${@"" if not d.getVar("GBMC_NCSI_IF_NAME") else \ +CXXFLAGS:append:gbmc = '${@"" if not d.getVar("GBMC_NCSI_IF_NAME") else \ " -DNCSI_IPMI_CHANNEL=1 -DNCSI_IF_NAME=" + d.getVar("GBMC_NCSI_IF_NAME")}' diff --git a/meta-google/recipes-google/ipmi/ipmi-fru-sh.bb b/meta-google/recipes-google/ipmi/ipmi-fru-sh.bb index deaee7aac..881e623e9 100644 --- a/meta-google/recipes-google/ipmi/ipmi-fru-sh.bb +++ b/meta-google/recipes-google/ipmi/ipmi-fru-sh.bb @@ -3,14 +3,14 @@ PR = "r1" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI += "file://lib.sh" S = "${WORKDIR}" DATA = "${datadir}/ipmi-fru" -FILES_${PN} += "${DATA}" +FILES:${PN} += "${DATA}" -do_install_append() { +do_install:append() { install -d -m0755 ${D}${DATA} install -m0644 lib.sh ${D}${DATA}/ } diff --git a/meta-google/recipes-google/ipmi/metrics-ipmi-blobs_git.bb b/meta-google/recipes-google/ipmi/metrics-ipmi-blobs_git.bb index 531d824dd..943747834 100644 --- a/meta-google/recipes-google/ipmi/metrics-ipmi-blobs_git.bb +++ b/meta-google/recipes-google/ipmi/metrics-ipmi-blobs_git.bb @@ -13,6 +13,6 @@ DEPENDS += " \ protobuf \ " -FILES_${PN} += "${libdir}/blob-ipmid" +FILES:${PN} += "${libdir}/blob-ipmid" EXTRA_OEMESON += "-Dtests=disabled" diff --git a/meta-google/recipes-google/nanopb/nanopb_0.4.5.bb b/meta-google/recipes-google/nanopb/nanopb_0.4.5.bb index 232872e75..1737cddb0 100644 --- a/meta-google/recipes-google/nanopb/nanopb_0.4.5.bb +++ b/meta-google/recipes-google/nanopb/nanopb_0.4.5.bb @@ -13,12 +13,12 @@ S = "${WORKDIR}/git" DEPENDS = "protobuf-native python3-protobuf" -RDEPENDS_${PN}-generator += "python3 python3-protobuf" +RDEPENDS:${PN}-generator += "python3 python3-protobuf" -PACKAGES_prepend = "${PN}-generator ${PN}-runtime " +PACKAGES:prepend = "${PN}-generator ${PN}-runtime " -FILES_${PN}-generator = "${libdir}/python* ${bindir}" +FILES:${PN}-generator = "${libdir}/python* ${bindir}" -FILES_${PN}-runtime = "${libdir}/*.so.*" +FILES:${PN}-runtime = "${libdir}/*.so.*" BBCLASSEXTEND = "native" diff --git a/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb b/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb index 89890266b..6480be1da 100644 --- a/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb +++ b/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb @@ -16,25 +16,25 @@ SRC_URI += " \ S = "${WORKDIR}" -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ gbmc-ip-monitor \ ncsid \ nftables-systemd \ sslh \ " -FILES_${PN} += " \ +FILES:${PN} += " \ ${datadir}/gbmc-ip-monitor \ ${systemd_unitdir} \ " -SYSTEMD_SERVICE_${PN} += " \ +SYSTEMD_SERVICE:${PN} += " \ gbmc-ncsi-sslh.service \ gbmc-ncsi-sslh.socket \ gbmc-ncsi-set-nicenabled.service \ " -do_install_append() { +do_install:append() { if_name='${GBMC_NCSI_IF_NAME}' if [ -z "$if_name" ]; then echo "Missing if_name" >&2 diff --git a/meta-google/recipes-google/ncsi/ncsid_git.bb b/meta-google/recipes-google/ncsi/ncsid_git.bb index 1acb45116..a67a3104b 100644 --- a/meta-google/recipes-google/ncsi/ncsid_git.bb +++ b/meta-google/recipes-google/ncsi/ncsid_git.bb @@ -10,7 +10,7 @@ EXTRA_OEMESON = " \ -Dtests=disabled \ " -SYSTEMD_SERVICE_${PN} += " \ +SYSTEMD_SERVICE:${PN} += " \ dhcp4@.service \ dhcp6@.service \ ncsid@.service \ @@ -26,7 +26,7 @@ DEPENDS += " \ stdplus \ " -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ bash \ busybox \ iputils-arping \ diff --git a/meta-google/recipes-google/networking/gbmc-bridge.bb b/meta-google/recipes-google/networking/gbmc-bridge.bb index 37af84baf..dea14f00b 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge.bb +++ b/meta-google/recipes-google/networking/gbmc-bridge.bb @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5 inherit systemd -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI += " \ file://-bmc-gbmcbr.netdev \ file://-bmc-gbmcbr.network.in \ @@ -22,14 +22,14 @@ SRC_URI += " \ file://gbmc-br-nft.sh \ " -FILES_${PN}_append = " \ +FILES:${PN}:append = " \ ${datadir}/gbmc-ip-monitor \ ${systemd_unitdir}/network \ ${sysconfdir}/nftables \ ${sysconfdir}/avahi/services \ " -RDEPENDS_${PN}_append = " \ +RDEPENDS:${PN}:append = " \ bash \ gbmc-ip-monitor \ mstpd-mstpd \ @@ -37,7 +37,7 @@ RDEPENDS_${PN}_append = " \ ndisc6-rdisc6 \ " -SYSTEMD_SERVICE_${PN} += "gbmc-br-ensure-ra.service" +SYSTEMD_SERVICE:${PN} += "gbmc-br-ensure-ra.service" GBMC_BR_MAC_ADDR ?= "" @@ -98,7 +98,7 @@ do_install() { install -m0755 ${WORKDIR}/gbmc-br-ensure-ra.service ${D}${systemd_system_unitdir}/ } -do_rm_work_prepend() { +do_rm_work:prepend() { # HACK: Work around broken do_rm_work not properly calling rm with `--` # It doesn't like filenames that start with `-` rm -rf -- ${WORKDIR}/-* diff --git a/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-br.rules b/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-br.rules index 1a5e6331d..475cc02f9 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-br.rules +++ b/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-br.rules @@ -16,10 +16,18 @@ table inet filter { jump gbmc_br_pub_input reject } + set gbmc_br_int_addrs { + type ipv6_addr; + flags interval + elements = { + ff00::/8, + fe80::/64, + fdb5:0481:10ce::/64, + } + } chain gbmc_br_int_input { - ip6 daddr ff00::/8 accept - ip6 daddr fe80::/64 accept - ip6 daddr fdb5:0481:10ce::/64 accept + ip6 daddr @gbmc_br_int_addrs accept + ip6 saddr @gbmc_br_int_addrs accept } chain gbmc_br_pub_input { ip6 nexthdr icmpv6 accept diff --git a/meta-google/recipes-google/networking/gbmc-ip-monitor.bb b/meta-google/recipes-google/networking/gbmc-ip-monitor.bb index 32804302b..1bf35bc9c 100644 --- a/meta-google/recipes-google/networking/gbmc-ip-monitor.bb +++ b/meta-google/recipes-google/networking/gbmc-ip-monitor.bb @@ -15,18 +15,18 @@ S = "${WORKDIR}" DEPENDS += "test-sh" -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ bash \ iproute2 \ " -SYSTEMD_SERVICE_${PN} += "gbmc-ip-monitor.service" +SYSTEMD_SERVICE:${PN} += "gbmc-ip-monitor.service" do_compile() { SYSROOT="$PKG_CONFIG_SYSROOT_DIR" bash gbmc-ip-monitor-test.sh || exit } -do_install_append() { +do_install:append() { install -d -m0755 ${D}${libexecdir} install -m0755 gbmc-ip-monitor.sh ${D}${libexecdir}/ diff --git a/meta-google/recipes-google/networking/gbmc-iperf3.bb b/meta-google/recipes-google/networking/gbmc-iperf3.bb index 27ebdb7e0..3b78a405f 100644 --- a/meta-google/recipes-google/networking/gbmc-iperf3.bb +++ b/meta-google/recipes-google/networking/gbmc-iperf3.bb @@ -5,11 +5,11 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5 inherit systemd -RDEPENDS_${PN} += "iperf3" +RDEPENDS:${PN} += "iperf3" SRC_URI += "file://iperf3.service" -SYSTEMD_SERVICE_${PN} += "iperf3.service" +SYSTEMD_SERVICE:${PN} += "iperf3.service" do_install() { # Install service definitions @@ -18,7 +18,7 @@ do_install() { } # Allow IPERF3 to run on the gbmcbr node on DEV builds -do_install_append_dev() { +do_install:append:dev() { nftables_dir=${D}${sysconfdir}/nftables rules=$nftables_dir/50-gbmc-iperf3-dev.rules install -d -m0755 $nftables_dir diff --git a/meta-google/recipes-google/networking/gbmc-mac-config.bb b/meta-google/recipes-google/networking/gbmc-mac-config.bb index 6ca4c798b..7a3781d1f 100644 --- a/meta-google/recipes-google/networking/gbmc-mac-config.bb +++ b/meta-google/recipes-google/networking/gbmc-mac-config.bb @@ -12,14 +12,14 @@ SRC_URI += " \ S = "${WORKDIR}" -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ bash \ ipmi-fru-sh \ " -FILES_${PN} += "${systemd_unitdir}" +FILES:${PN} += "${systemd_unitdir}" -SYSTEMD_SERVICE_${PN} += "gbmc-mac-config.service" +SYSTEMD_SERVICE:${PN} += "gbmc-mac-config.service" GBMC_MAC_EEPROM_OF_NAME ?= "" @@ -28,7 +28,7 @@ GBMC_MAC_EEPROM_OF_NAME ?= "" # Ex. "[0]=eth0 [2]=eth2" GBMC_MAC_IF_MAP ?= "" -do_install_append() { +do_install:append() { if [ -z '${GBMC_MAC_EEPROM_OF_NAME}' ]; then echo 'Missing GBMC_MAC_EEPROM_OF_NAME' >&2 exit 1 diff --git a/meta-google/recipes-google/networking/google-usb-network_git.bb b/meta-google/recipes-google/networking/google-usb-network_git.bb index ec51eaa5b..f0d15b94e 100644 --- a/meta-google/recipes-google/networking/google-usb-network_git.bb +++ b/meta-google/recipes-google/networking/google-usb-network_git.bb @@ -6,16 +6,16 @@ PV = "0.2" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" -FILESEXTRAPATHS_prepend = "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend = "${THISDIR}/${PN}:" inherit systemd DEPENDS += "m4-native" DEPENDS += "systemd" -RDEPENDS_${PN} += "bash" +RDEPENDS:${PN} += "bash" SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} = "usb_network.service" +SYSTEMD_SERVICE:${PN} = "usb_network.service" BMC_IP_ADDR ??= "169.254.95.118/16" BMC_USB_ECM_PRODUCT_ID ??= "" @@ -30,8 +30,8 @@ SRC_URI += "file://00-bmc-usb0.network.m4" SRC_URI += "file://usb_network.service.m4" SRC_URI += "file://usb_network.sh" -FILES_${PN} = "${bindir}/usb_network.sh" -FILES_${PN}_append = " ${systemd_unitdir}/network/${BMC_USB_CONFIG_FILENAME}" +FILES:${PN} = "${bindir}/usb_network.sh" +FILES:${PN}:append = " ${systemd_unitdir}/network/${BMC_USB_CONFIG_FILENAME}" do_compile() { test "X${BMC_IP_ADDR}" != "X" || bberror "Please define BMC_IP_ADDR" diff --git a/meta-google/recipes-google/networking/network-sh.bb b/meta-google/recipes-google/networking/network-sh.bb index a377b9e2a..921795b00 100644 --- a/meta-google/recipes-google/networking/network-sh.bb +++ b/meta-google/recipes-google/networking/network-sh.bb @@ -3,13 +3,13 @@ PR = "r1" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI += "file://lib.sh" SRC_URI += "file://test.sh" S = "${WORKDIR}" DATA = "${datadir}/network" -FILES_${PN} += "${DATA}" +FILES:${PN} += "${DATA}" DEPENDS += "test-sh" @@ -17,7 +17,7 @@ do_compile() { SYSROOT="$PKG_CONFIG_SYSROOT_DIR" bash test.sh || exit } -do_install_append() { +do_install:append() { install -d -m0755 ${D}${DATA} install -m0644 lib.sh ${D}${DATA}/ } diff --git a/meta-google/recipes-google/nftables/nftables-systemd.bb b/meta-google/recipes-google/nftables/nftables-systemd.bb index f4109ddc7..21a8b1aeb 100644 --- a/meta-google/recipes-google/nftables/nftables-systemd.bb +++ b/meta-google/recipes-google/nftables/nftables-systemd.bb @@ -13,9 +13,9 @@ SRC_URI += " \ file://nftables.service \ " -SYSTEMD_SERVICE_${PN} += "nftables.service" +SYSTEMD_SERVICE:${PN} += "nftables.service" -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ bash \ nftables \ " diff --git a/meta-google/recipes-google/ssh/authorized-keys-comp.bb b/meta-google/recipes-google/ssh/authorized-keys-comp.bb index 81ee868a8..ef0379286 100644 --- a/meta-google/recipes-google/ssh/authorized-keys-comp.bb +++ b/meta-google/recipes-google/ssh/authorized-keys-comp.bb @@ -12,15 +12,15 @@ SRC_URI += " \ S = "${WORKDIR}" -RDEPENDS_${PN} += "bash" +RDEPENDS:${PN} += "bash" -SYSTEMD_SERVICE_${PN} += "authorized-keys-comp.service" +SYSTEMD_SERVICE:${PN} += "authorized-keys-comp.service" -FILES_${PN} += "/home" +FILES:${PN} += "/home" AUTHORIZED_KEYS_COMP_USERS ?= "root" -do_install_append() { +do_install:append() { install -d -m0755 ${D}${libexecdir} install -m0755 authorized-keys-comp.sh ${D}${libexecdir}/ diff --git a/meta-google/recipes-google/ssh/gbmc-dev-ssh-key.bb b/meta-google/recipes-google/ssh/gbmc-dev-ssh-key.bb index a9d371e70..a402f511f 100644 --- a/meta-google/recipes-google/ssh/gbmc-dev-ssh-key.bb +++ b/meta-google/recipes-google/ssh/gbmc-dev-ssh-key.bb @@ -7,7 +7,7 @@ SRC_URI += "file://gbmc-dev.pub" S = "${WORKDIR}" -FILES_${PN} += " ${datadir}/authorized_keys.d" +FILES:${PN} += " ${datadir}/authorized_keys.d" do_install() { install -d ${D}${datadir}/authorized_keys.d/root diff --git a/meta-google/recipes-google/systemd/gbmc-systemd-config.bb b/meta-google/recipes-google/systemd/gbmc-systemd-config.bb index 29d81f46a..6e26fc99d 100644 --- a/meta-google/recipes-google/systemd/gbmc-systemd-config.bb +++ b/meta-google/recipes-google/systemd/gbmc-systemd-config.bb @@ -7,23 +7,23 @@ inherit systemd S = "${WORKDIR}" -SRC_URI_append = " \ +SRC_URI:append = " \ file://firmware-updates.target \ file://firmware-updates-pre.target \ file://40-gbmc-forward.conf \ " -FILES_${PN}_append = " \ +FILES:${PN}:append = " \ ${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf \ ${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf \ ${libdir}/sysctl.d/40-gbmc-forward.conf \ " -FILES_${PN}_append_dev = " \ +FILES:${PN}:append:dev = " \ ${libdir}/sysctl.d/40-gbmc-debug.conf \ " -SYSTEMD_SERVICE_${PN}_append = " \ +SYSTEMD_SERVICE:${PN}:append = " \ firmware-updates.target \ firmware-updates-pre.target \ " @@ -46,7 +46,7 @@ do_install() { install -m 0644 ${WORKDIR}/40-gbmc-forward.conf ${D}${libdir}/sysctl.d/ } -do_install_append_dev() { +do_install:append:dev() { printf "kernel.sysrq = 1\n" \ >${D}${libdir}/sysctl.d/40-gbmc-debug.conf } diff --git a/meta-google/recipes-google/test/test-sh.bb b/meta-google/recipes-google/test/test-sh.bb index 7edbb9189..eaca13739 100644 --- a/meta-google/recipes-google/test/test-sh.bb +++ b/meta-google/recipes-google/test/test-sh.bb @@ -3,19 +3,19 @@ PR = "r1" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI += "file://lib.sh" SRC_URI += "file://test.sh" S = "${WORKDIR}" DATA = "${datadir}/test" -FILES_${PN} += "${DATA}" +FILES:${PN} += "${DATA}" do_compile() { SYSROOT="$PKG_CONFIG_SYSROOT_DIR" bash test.sh || exit } -do_install_append() { +do_install:append() { install -d -m0755 ${D}${DATA} install -m0644 lib.sh ${D}${DATA}/ } |