From b60f2571972181a7c11c6c335b0335b28dc95c37 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 26 Mar 2021 06:35:42 -0500 Subject: Shutdown hangs when the EEPROM is not written yet because of no GPS device --- recipes-navigation/gpsd/gpsd/gpsd | 40 ++++++++++++++++++++---------------- recipes-navigation/gpsd/gpsd_3.20.bb | 2 +- 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. -- cgit v1.2.3