summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2021-02-12 12:17:52 +0200
committerJohn Klug <john.klug@multitech.com>2021-02-15 08:42:04 -0600
commit4ebe6db0cf0165c2477b6d4d0ed7298a294a46f7 (patch)
treeda9cb29678891b212b194a3c7909b062b09bbec6
parent85d676859ff536607b4ddf7f0175ae3442dd6aa2 (diff)
downloadmeta-mlinux-4ebe6db0cf0165c2477b6d4d0ed7298a294a46f7.tar.gz
meta-mlinux-4ebe6db0cf0165c2477b6d4d0ed7298a294a46f7.tar.bz2
meta-mlinux-4ebe6db0cf0165c2477b6d4d0ed7298a294a46f7.zip
add waiting of /dev/gps0
-rwxr-xr-xrecipes-navigation/gpsd/gpsd/gpsd21
1 files changed, 19 insertions, 2 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd b/recipes-navigation/gpsd/gpsd/gpsd
index b4068c9..36ca387 100755
--- a/recipes-navigation/gpsd/gpsd/gpsd
+++ b/recipes-navigation/gpsd/gpsd/gpsd
@@ -36,8 +36,25 @@ CAPABILITY=/sys/devices/platform/mts-io/capability/gps
# Exit if we have no GPS capability
( [[ -f $CAPABILITY ]] && (($(cat $CAPABILITY) == 1)) ) || exit 0
-# Exit if no gps found
-([[ -n $GPS_LINE ]] && [[ -c $GPS_LINE ]]) || exit 0
+([[ -n $GPS_LINE ]]) || exit 0
+
+((numtries = 10))
+if [[ $(cat /run/config/gpstype) == u-blox ]] ; then
+ while ((numtries > 0)) ; do
+ if [ -c $GPS_LINE ];then
+ logger -s -t 'gpsd info' -p daemon.info $GPS_LINE" found"
+ break
+ fi
+ sleep 1
+ done
+ if ((numtries == 0));then
+ logger -s -t 'gpsd info' -p daemon.info $GPS_LINE" not found. gpsd will not start"
+ exit 0
+ fi
+else
+ # Exit if no gps found
+ ([[ -c $GPS_LINE ]]) || exit 0
+fi
# Assemble the GPS devices
# PPS device is needed so GPSD finds the PPS.