summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-03-26 06:35:42 -0500
committerJohn Klug <john.klug@multitech.com>2021-06-22 09:29:50 -0500
commitb60f2571972181a7c11c6c335b0335b28dc95c37 (patch)
treea096a742a576b1374b580a8fe518a3c2da51f343
parent7c11f70d4c8e6f2c9e8e0abe8e839a9f69d02533 (diff)
downloadmeta-mlinux-b60f2571972181a7c11c6c335b0335b28dc95c37.tar.gz
meta-mlinux-b60f2571972181a7c11c6c335b0335b28dc95c37.tar.bz2
meta-mlinux-b60f2571972181a7c11c6c335b0335b28dc95c37.zip
Shutdown hangs when the EEPROM is not written yet because of no GPS device
-rwxr-xr-xrecipes-navigation/gpsd/gpsd/gpsd40
-rw-r--r--recipes-navigation/gpsd/gpsd_3.20.bb2
2 files changed, 23 insertions, 19 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd b/recipes-navigation/gpsd/gpsd/gpsd
index 36ca387..1f14107 100755
--- a/recipes-navigation/gpsd/gpsd/gpsd
+++ b/recipes-navigation/gpsd/gpsd/gpsd
@@ -38,24 +38,6 @@ CAPABILITY=/sys/devices/platform/mts-io/capability/gps
([[ -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.
if [[ -c $GPS_PPS ]] ; then
@@ -81,6 +63,28 @@ fi
#
do_start()
{
+ # Don't bother starting GPSD if the device does not exist
+ # Wait a little bit in case the device has not yet
+ # been enumerated.
+ ((numtries = 10))
+ if [[ $(cat /run/config/gpstype) == u-blox ]] ; then
+ while ((numtries > 0)) ; do
+ ((numtries--))
+ 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
+
/usr/sbin/start-stop-daemon -N -20 --start --quiet --pidfile $PIDFILE --exec $DAEMON --test \
-- $GPSD_OPTIONS -P $PIDFILE $GPS_DEVICES > /dev/null \
|| return 1
diff --git a/recipes-navigation/gpsd/gpsd_3.20.bb b/recipes-navigation/gpsd/gpsd_3.20.bb
index ba1b33e..514ca0a 100644
--- a/recipes-navigation/gpsd/gpsd_3.20.bb
+++ b/recipes-navigation/gpsd/gpsd_3.20.bb
@@ -4,7 +4,7 @@ LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=01764c35ae34d9521944bb6ab312af53"
DEPENDS = "dbus dbus-glib ncurses python3 libusb1 chrpath-replacement-native pps-tools"
PROVIDES = "virtual/gpsd"
-PR="m6"
+PR="m7"
#TODO
#the recipe generates python2 pygps package for Atmel based devices and python3 pygps package for TI based devices.