summaryrefslogtreecommitdiff
path: root/meta-quanta/meta-common/recipes-quanta
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-common/recipes-quanta
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-common/recipes-quanta')
-rw-r--r--meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh b/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh
index ebd6f027ec..8fc28cca77 100644
--- a/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh
+++ b/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh
@@ -6,25 +6,25 @@ host_mac_path="/tmp/usb0_host"
check_usb_local_administered() {
is_enable="$(cat ${mac_config} | grep 'USBLAA')"
- echo ${is_enable}
+ echo "${is_enable}"
}
# Set the locally administered bit (the second least-significant
# bit of the first octet) of the MAC address
set_local_administered_bit() {
- mac="$(tr -d '\0' < $1)"
+ mac="$(tr -d '\0' < "$1")"
first_byte="${mac:0:2}"
first_byte="$((0x$first_byte|2))"
first_byte="$(printf "%02x\n" "$first_byte")"
mac="${first_byte}${mac:2}"
- echo $mac
+ echo "$mac"
}
-cd /sys/kernel/config/usb_gadget
+cd /sys/kernel/config/usb_gadget || exit 1
if [ ! -f "g1" ]; then
mkdir g1
- cd g1
+ cd g1 || exit 1
echo 0x1d6b > idVendor # Linux foundation
echo 0x0104 > idProduct # Multifunction composite gadget
@@ -41,8 +41,8 @@ if [ ! -f "g1" ]; then
if [[ $(check_usb_local_administered) == "USBLAA=true" ]]; then
dev_mac="$(set_local_administered_bit $dev_mac_path)"
host_mac="$(set_local_administered_bit $host_mac_path)"
- echo $dev_mac > $dev_mac_path
- echo $host_mac > $host_mac_path
+ echo "$dev_mac" > $dev_mac_path
+ echo "$host_mac" > $host_mac_path
fi
mkdir -p functions/ecm.usb0