From 28d7752efa6215181a35dd5acafbf4ad4212ebfe Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Thu, 19 Dec 2019 14:47:43 +0100 Subject: [PATCH] ublox-gsm-fw-update: Fix blocking timeout when using RPM When running the script through RPM installer, the cat process does not stop when receiving the TERM signal. So the KILL signal has to be used to make sure that the script is not blocking. BugzID: 60344 --- .../ublox-gsm-fw-update/files/gsm-fw-update | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recipes-connectivity/ublox-gsm-fw-update/files/gsm-fw-update b/recipes-connectivity/ublox-gsm-fw-update/files/gsm-fw-update index 70824f2..0a9043c 100755 --- a/recipes-connectivity/ublox-gsm-fw-update/files/gsm-fw-update +++ b/recipes-connectivity/ublox-gsm-fw-update/files/gsm-fw-update @@ -34,13 +34,14 @@ if [ $? -eq 0 ]; then systemctl stop ModemManager fi -# Empty data in serial device +echo Empty data in serial device printf '\r\n' > $TTY_DEVICE -timeout 5 cat $TTY_DEVICE > /dev/null +timeout -k 5 5 cat $TTY_DEVICE > /dev/null +timeout -k 5 5 cat $TTY_DEVICE > /dev/null -# Check running version +echo Check running version printf '\r\nAT+CGMR\r\n' > $TTY_DEVICE -timeout 5 cat $TTY_DEVICE | grep -B3 -m 1 "OK" | grep "$FW_VERSION" +timeout -k 5 5 cat $TTY_DEVICE | grep -B3 -m 1 "OK" | grep "$FW_VERSION" if [ $? -eq 0 ]; then echo "The modem is already running the same FW version" @@ -53,6 +54,8 @@ else systemctl restart ublox-gsm-config fi +rm -rf $TMP_PATH + if [ "$MM_RUNNING" = "1" ]; then echo "Restarting ModemManager" systemctl start ModemManager