diff options
author | Brandon Kim <brandonkim@google.com> | 2024-07-12 07:22:19 +0300 |
---|---|---|
committer | Brandon Kim <brandonkim@google.com> | 2024-07-16 03:05:47 +0300 |
commit | 9339097331cc3538a6d93d773d7da304d3d8ca7f (patch) | |
tree | 9ed5555bc82ad1b30a039a2738f273bac2b173a9 /meta-quanta | |
parent | 5048d539da59a02c8adb02add559f5b16b7d941a (diff) | |
download | openbmc-9339097331cc3538a6d93d773d7da304d3d8ca7f.tar.xz |
meta-quanta: meta-gbs: Fix gbs-set-failsafe.sh
The busctl tree and grep used to get the number of zones is too wide and
the tree returns fans and sensors within the zone:
~# busctl tree xyz.openbmc_project.State.FanCtrl
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/settings
`- /xyz/openbmc_project/settings/fanctrl
|- /xyz/openbmc_project/settings/fanctrl/zone0
| |- /xyz/openbmc_project/settings/fanctrl/zone0/cputemp
...
...
`- /xyz/openbmc_project/settings/fanctrl/zone1
|- /xyz/openbmc_project/settings/fanctrl/zone1/nvme0
...
...
Which means running the grep gives more than the 2 zones that were meant
to be gotten resulting in trying to set the failsafe for many more
zones:
Jul 11 11:49:08 busctl[9642]: Failed to set property Target on interface xyz.openbmc_project.Control.FanSpeed: Unknown object '/xyz/openbmc_project/settings/fanctrl/zone4'.
Jul 11 11:49:09 busctl[9693]: Failed to set property Target on interface xyz.openbmc_project.Control.FanSpeed: Unknown object '/xyz/openbmc_project/settings/fanctrl/zone4'.
Jul 11 11:49:10 busctl[9744]: Failed to set property Target on interface xyz.openbmc_project.Control.FanSpeed: Unknown object '/xyz/openbmc_project/settings/fanctrl/zone4'.
Jul 11 11:49:11 busctl[9767]: Failed to set property Target on interface xyz.openbmc_project.Control.FanSpeed: Unknown object '/xyz/openbmc_project/settings/fanctrl/zone4'.
Jul 11 11:49:12 gbs-set-failsafe.sh[8710]: Failure setting zone4 fan failsafe to 255
...
...
Tested:
With the change, the grep correctly gives "2" as the number of zones:
~# busctl tree xyz.openbmc_project.State.FanCtrl | grep -c -E 'zone[0-9]$'
2
Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I1efd09b8d99ec00027489a05b647b43b1186c038
Diffstat (limited to 'meta-quanta')
-rw-r--r-- | meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh index 8d6f774c84..4b20341086 100644 --- a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh @@ -22,7 +22,7 @@ if [ -z "$target_pwm" ]; then exit 1 fi -zone_num="$(busctl tree xyz.openbmc_project.State.FanCtrl | grep -c zone)" +zone_num="$(busctl tree xyz.openbmc_project.State.FanCtrl | grep -c -E 'zone[0-9]$')" result=0 for (( i = 0; i < zone_num; i++ )); do |