diff options
author | John Klug <john.klug@multitech.com> | 2016-12-13 14:56:49 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2016-12-13 14:56:49 -0600 |
commit | 12465c3b11e4a7517a92480980f1ce2f8a877e71 (patch) | |
tree | f1c7e07c223742a7ca1545e1fbdadf9a34e41994 /recipes-navigation/gpsd/gpsd | |
parent | 1d0f3f0697733eafa8f113d585187ef02b1b56f7 (diff) | |
download | meta-mlinux-12465c3b11e4a7517a92480980f1ce2f8a877e71.tar.gz meta-mlinux-12465c3b11e4a7517a92480980f1ce2f8a877e71.tar.bz2 meta-mlinux-12465c3b11e4a7517a92480980f1ce2f8a877e71.zip |
GPSD 3.14 Bitbake recipe
Diffstat (limited to 'recipes-navigation/gpsd/gpsd')
-rw-r--r-- | recipes-navigation/gpsd/gpsd/60-gpsd.rules | 47 | ||||
-rw-r--r-- | recipes-navigation/gpsd/gpsd/Conduit.patch | 14 | ||||
-rwxr-xr-x | recipes-navigation/gpsd/gpsd/gpsd | 136 | ||||
-rw-r--r-- | recipes-navigation/gpsd/gpsd/gpsd-default | 5 | ||||
-rw-r--r-- | recipes-navigation/gpsd/gpsd/gpsd.service | 10 |
5 files changed, 198 insertions, 14 deletions
diff --git a/recipes-navigation/gpsd/gpsd/60-gpsd.rules b/recipes-navigation/gpsd/gpsd/60-gpsd.rules new file mode 100644 index 0000000..61143b8 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd/60-gpsd.rules @@ -0,0 +1,47 @@ +# udev rules for gpsd +# $Id$ +# +# GPSes don't have their own USB device class. They're serial-over-USB +# devices, so what you see is actually the ID of the serial-over-USB chip. +# Fortunately, just two of these account for over 80% of consumer-grade +# GPS sensors. The gpsd.hotplug.wrapper script will tell a running gpsd +# that it should look at the device that just went active, because it +# might be a GPS. +# +# The following setup works on Debian - something similar will apply on +# other distributions: +# +# /etc/udev/gpsd.rules +# /etc/udev/rules.d/025_gpsd.rules -> ../gpsd.rules +# /lib/udev/gpsd.hotplug.wrapper +# /lib/udev/gpsd.hotplug +# +# Setting the link in /etc/udev/rules.d activates the rule and determines +# when to run it on boot (similar to init.d processing). + +SUBSYSTEM!="tty", GOTO="gpsd_rules_end" + +# Prolific Technology, Inc. PL2303 Serial Port +ATTR{idVendor}=="067b", ATTR{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# ATEN International Co., Ltd UC-232A Serial Port [pl2303] +ATTR{idVendor}=="0557", ATTR{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# FTDI 8U232AM +ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# Cypress M8/CY7C64013 (DeLorme uses these) +ATTR{idVendor}=="1163", ATTR{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005) +ATTR{idVendor}=="067b", ATTR{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB) +ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241) +ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# u-blox AG, u-blox 5 (tested with Navilock NL-402U) +ATTR{idVendor}=="1546", ATTR{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# FTDI FT232 +ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# u-blox 4 +ATTR{idVendor}=="1546", ATTR{idProduct}=="01a4", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" + +ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper" + +LABEL="gpsd_rules_end" diff --git a/recipes-navigation/gpsd/gpsd/Conduit.patch b/recipes-navigation/gpsd/gpsd/Conduit.patch deleted file mode 100644 index 0fced15..0000000 --- a/recipes-navigation/gpsd/gpsd/Conduit.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -uprN old/gpsd new/gpsd ---- old/gpsd 2016-11-14 14:37:19.733762786 -0600 -+++ new/gpsd 2016-11-14 14:43:28.733762007 -0600 -@@ -93,6 +93,10 @@ do_reload() { - - case "$1" in - start) -+ if ! [[ -r /sys/devices/platform/mts-io/gnss-int ]] ; then -+ echo "No GPS available" -+ exit -+ fi - echo "Starting $DESC" "$NAME" - do_start - exit $? diff --git a/recipes-navigation/gpsd/gpsd/gpsd b/recipes-navigation/gpsd/gpsd/gpsd new file mode 100755 index 0000000..ba73daf --- /dev/null +++ b/recipes-navigation/gpsd/gpsd/gpsd @@ -0,0 +1,136 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: gpsd +# Required-Start: $remote_fs $network +# Should-Start: bluetooth dbus udev +# Required-Stop: $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: GPS (Global Positioning System) daemon start/stop script +# Description: Start/Stop script for the gpsd service daemon, +# which is able to monitor one or more GPS devices +# connected to a host computer, making all data on +# the location and movements of the sensors available +# to be queried on TCP port 2947. +### END INIT INFO + +# Author: Bernd Zeimetz <bzed@debian.org> +# +# Please remove the "Author" lines above and replace them +# with your own name if you copy and modify this script. + +# Do NOT "set -e" + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="GPS (Global Positioning System) daemon" +NAME=gpsd +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration, if present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then + GPSD_SOCKET=/var/run/gpsd.sock +fi + +if [ -n "$GPSD_SOCKET" ]; then + GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET" +fi + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test \ + -- $GPSD_OPTIONS -P $PIDFILE $GPS_DEVICES > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + $GPSD_OPTIONS -P $PIDFILE $GPS_DEVICES \ + || return 2 +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +# +# Function that sends a SIGHUP to the daemon/service +# +do_reload() { + # + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + # + start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME + return 0 +} + +case "$1" in + start) + echo "Starting $DESC" "$NAME" + do_start + exit $? + ;; + stop) + echo "Stopping $DESC" "$NAME" + do_stop + exit $? + ;; + status) + ;; + reload|force-reload) + echo "Reloading $DESC" "$NAME" + do_reload + exit $? + ;; + restart) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + echo "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + exit $? + ;; + *) + # Failed to stop + exit 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/recipes-navigation/gpsd/gpsd/gpsd-default b/recipes-navigation/gpsd/gpsd/gpsd-default new file mode 100644 index 0000000..0ceff03 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd/gpsd-default @@ -0,0 +1,5 @@ +# If you must specify a non-NMEA driver, uncomment and modify the next line +GPSD_SOCKET="/var/run/gpsd.sock" +GPSD_OPTIONS="" +GPS_DEVICES="" + diff --git a/recipes-navigation/gpsd/gpsd/gpsd.service b/recipes-navigation/gpsd/gpsd/gpsd.service new file mode 100644 index 0000000..7131a58 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd/gpsd.service @@ -0,0 +1,10 @@ +[Unit] +Description=GPS (Global Positioning System) Daemon +Requires=gpsd.socket + +[Service] +EnvironmentFile=/etc/default/gpsd +ExecStart=/usr/sbin/gpsd -N $GPS_DEVICES + +[Install] +Also=gpsd.socket |