summaryrefslogtreecommitdiff
path: root/meta-quanta/meta-olympus-nuvoton
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2023-04-16 04:05:21 +0300
committerPatrick Williams <patrick@stwcx.xyz>2023-04-27 19:16:12 +0300
commit8c2262344c1fc1f8708f4a44af395ea8c49f12e2 (patch)
treec77f039128cd588f75b89a2272248960b3482baf /meta-quanta/meta-olympus-nuvoton
parentbd58e95482128fa5aefb97125613e6b23723e85e (diff)
downloadopenbmc-8c2262344c1fc1f8708f4a44af395ea8c49f12e2.tar.xz
meta-quanta: fix shellcheck issues
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I189baf142cc86d44ebbf615edd3bb0ec1785be8d
Diffstat (limited to 'meta-quanta/meta-olympus-nuvoton')
-rw-r--r--meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu/first-boot-set-psu.sh42
-rw-r--r--meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh2
2 files changed, 21 insertions, 23 deletions
diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu/first-boot-set-psu.sh b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu/first-boot-set-psu.sh
index 04b447615a..caceb5f788 100644
--- a/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu/first-boot-set-psu.sh
+++ b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu/first-boot-set-psu.sh
@@ -2,19 +2,19 @@
string=''
pmbus_read() {
- data=$(i2cget -f -y $1 $2 $3 i $4)
+ data=$(i2cget -f -y "$1" "$2" "$3" i "$4")
if [[ -z "$data" ]]; then
echo "i2c$1 device $2 command $3 error" >&2
exit 1
fi
- arry=$(echo ${data} | sed -e "s/$4\: //" | sed -e "s/\0x00//g" | sed -e "s/\0xff//g" | sed -e "s/\0x7f//g" | sed -e "s/\0x0f//g" | sed -e "s/\0x14//g")
+ arry=$(echo "${data}" | sed -e "s/$4\: //" | sed -e "s/\0x00//g" | sed -e "s/\0xff//g" | sed -e "s/\0x7f//g" | sed -e "s/\0x0f//g" | sed -e "s/\0x14//g")
string=''
for d in ${arry}
do
- hex=$(echo $d | sed -e "s/0\x//")
+ hex=${d/0x}
string+=$(echo -e "\x${hex}");
done
}
@@ -28,9 +28,9 @@ update_inventory() {
${INVENTORY_SERVICE} \
${INVENTORY_OBJECT} \
${INVENTORY_PATH} \
- Notify a{oa{sa{sv}}} 1 \
- ${OBJECT_PATH} 1 $2 $3 \
- $4 $5 $6
+ Notify "a{oa{sa{sv}}}" 1 \
+ "${OBJECT_PATH}" 1 "$2" "$3" \
+ "$4" "$5" "$6"
}
if [ $# -eq 0 ]; then
@@ -38,24 +38,22 @@ if [ $# -eq 0 ]; then
exit 1
fi
-input=$(echo $1 | tr "-" " ")
-arr=(${input// / });
+IFS=" " read -ra arr <<< "${1//- /}"
+pmbus_read "${arr[1]}" "${arr[2]}" 0x99 11
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "Manufacturer" "s" "$string"
-pmbus_read ${arr[1]} ${arr[2]} 0x99 11
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "Manufacturer" "s" $string
+pmbus_read "${arr[1]}" "${arr[2]}" 0x9a 11
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "Model" "s" "$string"
-pmbus_read ${arr[1]} ${arr[2]} 0x9a 11
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "Model" "s" $string
+pmbus_read "${arr[1]}" "${arr[2]}" 0xad 21
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "PartNumber" "s" "$string"
-pmbus_read ${arr[1]} ${arr[2]} 0xad 21
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "PartNumber" "s" $string
+pmbus_read "${arr[1]}" "${arr[2]}" 0x9e 18
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "SerialNumber" "s" "$string"
-pmbus_read ${arr[1]} ${arr[2]} 0x9e 18
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Decorator.Asset" 1 "SerialNumber" "s" $string
-
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Decorator.Cacheable" 1 "Cached" "b" "true"
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Decorator.Replaceable" 1 "FieldReplaceable" "b" "true"
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Item" 1 "Present" "b" "true"
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Item" 1 "PrettyName" "s" "powersupply${arr[0]}"
-update_inventory ${arr[0]} "xyz.openbmc_project.Inventory.Item.PowerSupply" 0
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Decorator.Cacheable" 1 "Cached" "b" "true"
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Decorator.Replaceable" 1 "FieldReplaceable" "b" "true"
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Item" 1 "Present" "b" "true"
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Item" 1 "PrettyName" "s" "powersupply${arr[0]}"
+update_inventory "${arr[0]}" "xyz.openbmc_project.Inventory.Item.PowerSupply" 0
diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh
index 9a0d8e2e7d..243823ae04 100644
--- a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh
+++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh
@@ -1,3 +1,3 @@
-#!bin/bash
+#!/bin/bash
echo 255 > /sys/class/hwmon/*/pwm1