diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2023-04-14 22:45:30 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2023-04-20 14:36:29 +0300 |
commit | 1f2505f16f1a279a78d9066ef969a0539b6d0352 (patch) | |
tree | 537bc11c19119a4092729d91ae268873ac7609c8 | |
parent | 8b86a4153fd24d74a87aa19141a0c8ebd1b23b80 (diff) | |
download | openbmc-1f2505f16f1a279a78d9066ef969a0539b6d0352.tar.xz |
meta-ingrasys: fix shellcheck issues
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5fd106fcc9de9895bc0d79f265e5c0ab06ee624a
4 files changed, 19 insertions, 22 deletions
diff --git a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh index 57e7f99b20..93d1928f51 100755 --- a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh +++ b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh @@ -18,8 +18,8 @@ i2c_path="/sys/bus/i2c/devices/" # Initializes the AVSBus VOUT setpoint to the value in PMBus VOUT_COMMAND vrm_avs_enable() { - echo Enabling AVSBus on bus $1 VRM @$2 rail $3... - echo 1 > $(echo ${i2c_path}/$1-$(printf "%04x" $2)/hwmon/hwmon*/avs$(printf "%d" $3)_enable) + echo "Enabling AVSBus on bus $1 VRM @$2 rail $3..." + echo 1 > "${i2c_path}/$1-$(printf "%04x" "$2")/hwmon/hwmon*/avs$(printf "%d" "$3")_enable" } # Usage: vrm_avs_disable <bus> <i2c_address> <page> @@ -29,8 +29,8 @@ vrm_avs_enable() # - AVSBus Copy: VOUT_COMMAND remains unchanged vrm_avs_disable() { - echo Disabling AVSBus on bus $1 VRM @$2 rail $3... - echo 0 > $(echo ${i2c_path}/$1-$(printf "%04x" $2)/hwmon/hwmon*/avs$(printf "%d" $3)_enable) + echo "Disabling AVSBus on bus $1 VRM @$2 rail $3..." + echo 0 > "${i2c_path}/$1-$(printf "%04x" "$2")/hwmon/hwmon*/avs$(printf "%d" "$3")_enable" } # Usage: for_each_rail <command> @@ -41,15 +41,15 @@ for_each_rail() do for addr_page in $addrs_pages do - $1 $bus `echo $addr_page | tr : " "` + $1 "$bus" "$(echo "$addr_page" | tr : " ")" done done } -if [ "$1" == "enable" ] +if [ "$1" = "enable" ] then for_each_rail vrm_avs_enable -elif [ "$1" == "disable" ] +elif [ "$1" = "disable" ] then for_each_rail vrm_avs_disable else diff --git a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control.bb b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control.bb index 903ce4545c..e6ab99ff34 100644 --- a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control.bb +++ b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control.bb @@ -21,7 +21,7 @@ SYSTEMD_SERVICE:${PN} += "${TMPL_ON}" SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_ON', 'OBMC_CHASSIS_INSTANCES')}" SRC_URI += "file://zaius_vcs.sh" -RDEPENDS:${PN} += "i2c-tools" +RDEPENDS:${PN} += "bash i2c-tools" do_install() { install -d ${D}${bindir} diff --git a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh index 49bf0b04f5..528bc3677d 100755 --- a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh +++ b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh @@ -1,12 +1,10 @@ -#!/bin/sh -e +#!/bin/bash -e # Read and control VCS rails by sending the UCD power sequencer I2C commands. # This script assumes that the UCD is controlling VCS rails as GPIOs 5 and 6. # Also assumes that those GPIOs are already enabled. ucd_bus="0" ucd_addr="0x64" -ucd_path="/sys/bus/i2c/drivers/ucd9000" -ucd_driver="${ucd_bus}-00${ucd_addr#0x}" ucd_retries="5" retry() @@ -14,7 +12,7 @@ retry() local i=0 until [ $i -ge $ucd_retries ]; do i=$((i+1)) - retry_output=`$@` && break + retry_output=$("$@") && break done local ret=$? if [ $i -eq $ucd_retries ]; then exit $ret; fi @@ -24,26 +22,26 @@ retry() # Result stored in $ucd_reg ucd_get() { - retry i2cget -f -y $ucd_bus $ucd_addr $1 b + retry i2cget -f -y $ucd_bus $ucd_addr "$1" b ucd_reg=$retry_output } # Usage: ucd_get address value ucd_set() { - retry i2cset -f -y $ucd_bus $ucd_addr $1 $2 b + retry i2cset -f -y $ucd_bus $ucd_addr "$1" "$2" b } vcs_set_gpios() { echo -e "\tSetting UCD GPIO 5 to $1" ucd_set 0xFA 5 - ucd_set 0xFB $1 - ucd_set 0xFB $1 + ucd_set 0xFB "$1" + ucd_set 0xFB "$1" echo -e "\tSetting UCD GPIO 6 to $1" ucd_set 0xFA 6 - ucd_set 0xFB $1 - ucd_set 0xFB $1 + ucd_set 0xFB "$1" + ucd_set 0xFB "$1" } vcs_get() @@ -51,11 +49,12 @@ vcs_get() echo Reading VCS settings ucd_set 0xFA 5 ucd_get 0xFB - local val=`echo $ucd_reg | grep -i -c 0x0f` + local val= + val=$(echo "$ucd_reg" | grep -i -c 0x0f) echo -e "\tUCD GPIO 5 state=$val" ucd_set 0xFA 6 ucd_get 0xFB - local val=`echo $ucd_reg | grep -i -c 0x0f` + val=$(echo "$ucd_reg" | grep -i -c 0x0f) echo -e "\tUCD GPIO 6 state=$val" } diff --git a/meta-phosphor/scripts/run-repotest b/meta-phosphor/scripts/run-repotest index 2d8a04cefb..cbb7f42315 100755 --- a/meta-phosphor/scripts/run-repotest +++ b/meta-phosphor/scripts/run-repotest @@ -127,8 +127,6 @@ meta-google/recipes-phosphor/flash/google-key/verify-bmc-image.sh meta-google/recipes-phosphor/flash/inplace-gbmc-update/inplace-gbmc-verify.sh meta-ibm/meta-romulus/recipes-phosphor/chassis/vrm-control/vrm-control.sh meta-ibm/recipes-phosphor/chassis/vrm-control/vrm-control.sh -meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh -meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh meta-inventec/meta-transformers/recipes-phosphor/init/transformers-init/transformers-init.sh meta-openpower/recipes-bsp/pdata/files/power-target.sh meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh |