Browse Source

new templates, hotplug wrapper and rules

git-svn-id: https://ssl.recluse.de/svn/debian/packages/gpsd/trunk@518 9c2cd6cd-4e54-406b-9ece-f07a8ab7d216
tags/debian/2.37-6
bzed 13 years ago
parent
commit
4d203a1909
4 changed files with 48 additions and 11 deletions
  1. +13
    -0
      debian/gpsd.hotplug.wrapper
  2. +6
    -3
      debian/gpsd.postinst
  3. +28
    -7
      debian/gpsd.rules
  4. +1
    -1
      debian/gpsd.templates

+ 13
- 0
debian/gpsd.hotplug.wrapper View File

@@ -1,4 +1,17 @@
#! /bin/sh
# $Id: gpsd.hotplug.wrapper 4669 2008-01-21 15:07:00Z esr $

#debian addition:
. /etc/default/gpsd
[ "$USBAUTO" = "true" ] || exit 0


if [ "$ACTION" == "remove" ] ; then
if [ $(echo $DEVLINKS | grep -q /dev/gps) ] ; then
exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
fi
exit 0
fi

. /lib/udev/hotplug.functions



+ 6
- 3
debian/gpsd.postinst View File

@@ -14,13 +14,16 @@ if [ "$1" = "configure" ] ; then
START=$RET
db_get gpsd/daemon_options
OPTS=$RET
db_get gpsd/autodetection
USBAUTO=$RET

cat <<EOF > /etc/default/gpsd
# Default settings for gpsd. This file is sourced from
# /etc/init.d/gpsd.
START_DAEMON="$START"
# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
DAEMON_OPTS="$OPTS"
DEVICES="$DEVICES"
USBAUTO="$USBAUTO"
EOF

fi


+ 28
- 7
debian/gpsd.rules View File

@@ -1,18 +1,39 @@
# udev rules for gpsd
# $Id: gpsd.rules 4649 2008-01-01 14:35:42Z esr $
#
# 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 gpsdplug script will tell a running gpsd that it should
# look at the device that just went active, because it might be a GPS.
# 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
SUBSYSTEM=="tty", SYSFS{idVendor}=="067b", SYSFS{idProduct}=="2303", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
SYSFS{idVendor}=="067b", SYSFS{idProduct}=="2303", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# ATEN International Co., Ltd UC-232A Serial Port [pl2303]
SUBSYSTEM=="tty", SYSFS{idVendor}=="0557", SYSFS{idProduct}=="2008", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
SYSFS{idVendor}=="0557", SYSFS{idProduct}=="2008", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# FTDI 8U232AM
SUBSYSTEM=="tty", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# Cypress M8/CY7C64013 (DeLorme uses these)
SUBSYSTEM=="tty", SYSFS{idVendor}=="1163", SYSFS{idProduct}=="0100", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
SYSFS{idVendor}=="1163", SYSFS{idProduct}=="0100", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005)
SUBSYSTEM=="tty", SYSFS{idVendor}=="067b", SYSFS{idProduct}=="aaa0", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
SYSFS{idVendor}=="067b", SYSFS{idProduct}=="aaa0", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB)
SYSFS{idVendor}=="091e", SYSFS{idProduct}=="0003", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"

ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper"

LABEL="gpsd_rules_end"

+ 1
- 1
debian/gpsd.templates View File

@@ -1,7 +1,7 @@
Template: gpsd/device
Type: string
_Description: Device the GPS receiver is attached to:
Please enter the device the GPS receiver is attached to. This will probably be
Please enter the device the GPS receiver is attached to. It will probably be
something like /dev/ttyS0 or /dev/ttyUSB0.
.
Multiple devices may be specified as a space-separated list.


Loading…
Cancel
Save