meta-facebook: fix up new shellcheck warnings
New docker container is flagging some issues in this shell script:
```
SC2004 (style): $/${} is unnecessary on arithmetic variables.
SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
```
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I9806a097ca417d8677374efd666f2a8865a0a2fd
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor b/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor
index f34e4bd..20a1913 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor
@@ -143,18 +143,18 @@
fi
if [ "$HOST_STATE" = "${HOST_PREVIOUS_STATE[$i]}" ]; then
- HOST_STATE_CHANGE_CHECK[$i]="$HOST_STATE_CHANGE_CHECH_CNT"
+ HOST_STATE_CHANGE_CHECK[i]="$HOST_STATE_CHANGE_CHECH_CNT"
elif [ "${HOST_STATE_CHANGE_CHECK[$i]}" -gt "0" ]; then
echo "SLED$i: detected state changed (previous:${HOST_PREVIOUS_STATE[$i]}, current:$HOST_STATE), check count: ${HOST_STATE_CHANGE_CHECK[$i]}"
- HOST_STATE_CHANGE_CHECK[$i]=$((HOST_STATE_CHANGE_CHECK[i]-1))
+ HOST_STATE_CHANGE_CHECK[i]=$((HOST_STATE_CHANGE_CHECK[i]-1))
else
echo "SLED$i: detected state changed, update host state to $HOST_STATE"
update_host_acpi_power_state "$i" "${HOST_ACPI_ST_MAP[$HOST_STATE]}"
update_host_state "$i" "${HOST_STATE_MAP[$HOST_STATE]}"
update_chassis_power_state "$i" "${CHASSIS_PWR_STATE_MAP[$HOST_STATE]}"
update_sled_led_state "$i" "$HOST_STATE"
- HOST_STATE_CHANGE_CHECK[$i]="$HOST_STATE_CHANGE_CHECH_CNT"
- HOST_PREVIOUS_STATE[$i]="$HOST_STATE"
+ HOST_STATE_CHANGE_CHECK[i]="$HOST_STATE_CHANGE_CHECH_CNT"
+ HOST_PREVIOUS_STATE[i]="$HOST_STATE"
fi
done
sleep 1
diff --git a/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite
index d30ed89..46d72f4 100644
--- a/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite
+++ b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite
@@ -10,13 +10,13 @@
for i in {0..5}
do
- SLED_NVME_PCIE_EN[$i]=0
+ SLED_NVME_PCIE_EN[i]=0
for file in /sys/bus/i2c/drivers/pca953x/"$i"-0041/gpio/gpiochip*/base
do
if [ -f "$file" ]; then
GPIOCHIP_BASE="$(cat /sys/bus/i2c/drivers/pca953x/"$i"-0041/gpio/gpiochip*/base)"
- SLED_NVME_PCIE_EN[$i]=$((GPIOCHIP_BASE+3))
- export_gpio ${SLED_NVME_PCIE_EN[$i]}
+ SLED_NVME_PCIE_EN[i]=$((GPIOCHIP_BASE+3))
+ export_gpio "${SLED_NVME_PCIE_EN[i]}"
break
fi
done
diff --git a/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/set-bmc-time-from-host b/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/set-bmc-time-from-host
index 40b3b8c..8d6d3ae 100644
--- a/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/set-bmc-time-from-host
+++ b/meta-facebook/recipes-phosphor/datetime/phosphor-time-manager/set-bmc-time-from-host
@@ -72,7 +72,7 @@
if [[ $(echo "$multi_host_time_result" | awk '{ print NF }') -eq 18 ]];
then
- echo "syncing up host " $index " date time with bmc..."
+ echo "syncing up host " "$index" " date time with bmc..."
date -s @$((0x$(echo "$multi_host_time_result" | \
awk '{printf "%02x%02x%02x%02x",$18,$17,$16,$15}')))
sync
diff --git a/meta-facebook/recipes-phosphor/fans/phosphor-fan/greatlakes/host-poweroff b/meta-facebook/recipes-phosphor/fans/phosphor-fan/greatlakes/host-poweroff
index bd43954..3b4d9d9 100644
--- a/meta-facebook/recipes-phosphor/fans/phosphor-fan/greatlakes/host-poweroff
+++ b/meta-facebook/recipes-phosphor/fans/phosphor-fan/greatlakes/host-poweroff
@@ -19,7 +19,7 @@
echo "chosen host id :::$host_id"
# host power off
- output=$(busctl set-property $DBUS_SERVICE$host_id $DBUS_OBJECT$host_id $DBUS_INTERFACE $DBUS_PROPERTY s $PROPERTY_VALUE)
+ output=$(busctl set-property $DBUS_SERVICE"$host_id" $DBUS_OBJECT"$host_id" $DBUS_INTERFACE $DBUS_PROPERTY s $PROPERTY_VALUE)
echo "$output"
done
diff --git a/meta-facebook/recipes-phosphor/fans/phosphor-fan/yosemitev2/host-poweroff b/meta-facebook/recipes-phosphor/fans/phosphor-fan/yosemitev2/host-poweroff
index 782f085..14638d6 100644
--- a/meta-facebook/recipes-phosphor/fans/phosphor-fan/yosemitev2/host-poweroff
+++ b/meta-facebook/recipes-phosphor/fans/phosphor-fan/yosemitev2/host-poweroff
@@ -19,7 +19,7 @@
echo "chosen host id :::$host_id"
# host power off
- output=$(busctl set-property $DBUS_SERVICE$host_id $DBUS_OBJECT$host_id $DBUS_INTERFACE $DBUS_PROPERTY s $PROPERTY_VALUE)
+ output=$(busctl set-property $DBUS_SERVICE"$host_id" $DBUS_OBJECT"$host_id" $DBUS_INTERFACE $DBUS_PROPERTY s $PROPERTY_VALUE)
echo "$output"
done