From 00925c222af65379311c91896b31eee66733b2d0 Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Fri, 12 Feb 2021 12:17:52 +0200 Subject: add waiting of /dev/gps0 --- recipes-navigation/gpsd/gpsd/gpsd | 21 +++++++++++++++++++-- 1 file 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. -- cgit v1.2.3