summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-09-05 18:39:51 -0500
committerJohn Klug <john.klug@multitech.com>2017-09-05 18:39:51 -0500
commit25f33d55fa67a6a9e0c8a39f36a2ce7c8a41057b (patch)
treee472b22ab527383b3f179c1d8d7e03dc819c7c79
parent8abd0036264884dd5f8c400c8aaf9786cc426a98 (diff)
downloadmeta-mlinux-25f33d55fa67a6a9e0c8a39f36a2ce7c8a41057b.tar.gz
meta-mlinux-25f33d55fa67a6a9e0c8a39f36a2ce7c8a41057b.tar.bz2
meta-mlinux-25f33d55fa67a6a9e0c8a39f36a2ce7c8a41057b.zip
Avoid unnecessary chat switches, and less logging
-rwxr-xr-xrecipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn22
-rwxr-xr-xrecipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-cell-fw4
2 files changed, 18 insertions, 8 deletions
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
index da87cd3..535ab17 100755
--- a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
+++ b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
@@ -31,10 +31,14 @@ function setchat {
>&2 echo "Invalid firmware SKU $fw"
return 1
else
- if ((silent == 0)) ; then
- echo "Setting chat script to ${lna3_chat_file[$fw]}"
+ canon_src=$(readlink -f "${lna3_chat_file[$fw]}")
+ canon_dest=$(readlink -f "${lna3_chat_link}")
+ if [[ ${canon_src} != ${canon_dest} ]] ; then
+ if ((silent == 0)) ; then
+ echo "Setting chat script to ${lna3_chat_file[$fw]}"
+ fi
+ ln -sf "${lna3_chat_file[$fw]}" "${lna3_chat_link}"
fi
- ln -sf "${lna3_chat_file[$fw]}" "${lna3_chat_link}"
fi
}
@@ -93,8 +97,14 @@ else
fi
if fwreply=$(/usr/sbin/mlinux-switch-cell-fw -1); then
- [[ $fwreply =~ Cellular[[:space:]]+radio[[:space:]]+firmware[[:space:]]+has[[:space:]]+been[[:space:]]+switched[[:space:]]+to[[:space:]]+([^[:space:]]*)[[:space:]]+image\. ]]
- fw=${BASH_REMATCH[1]}
- setchat $fw 0
+ if [[ $fwreply =~ Cellular[[:space:]]+radio[[:space:]]+firmware[[:space:]]+has[[:space:]]+(already[[:space:]]+)been[[:space:]]+switched[[:space:]]+to[[:space:]]+([^[:space:]]*)[[:space:]]+image\. ]] ; then
+ fw=${BASH_REMATCH[2]}
+ setchat $fw 0
+ else
+ fw=$(radio-query --active-firmware)
+ if (($? == 0)) ; then
+ setchat $fw 0
+ fi
+ fi
fi
fi \ No newline at end of file
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-cell-fw b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-cell-fw
index 62eb19d..9edacac 100755
--- a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-cell-fw
+++ b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-cell-fw
@@ -24,7 +24,7 @@ FWIMAGE=$1
if ((FWIMAGE < -2)) || ((FWIMAGE > 1)) ; then
usage
fi
-if ! /usr/sbin/mlinux-cell-radio-ready ; then
+if ! >&2 /usr/sbin/mlinux-cell-radio-ready ; then
[ "$VERBOSE" ] && >&2 echo Radio is not ready
[ "$VERBOSE" ] && >&2 echo Try again later
exit 1
@@ -85,7 +85,7 @@ if [ $? -ne 0 ] || [ "$FWACTIVE" == "" ]; then
fi
if (( FWACTIVE == FWIMAGE )); then
- [ "$VERBOSE" ] && >&2 echo "The radio firmware image is already set."
+ echo "Cellular radio firmware has already been switched to $FWIMAGE image."
exit 0
fi