add all my local ebuilds
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@602 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
4
sci-geosciences/gpsd/files/40-usb-serial.rules
Normal file
4
sci-geosciences/gpsd/files/40-usb-serial.rules
Normal file
@@ -0,0 +1,4 @@
|
||||
# Sample udev rule for ttyUSB devices used by cheap GPS hardware (for use with
|
||||
# gpsd) such as a PL2303 USB-Serial adapter.
|
||||
|
||||
KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", SYMLINK="ttyUSB%n", GROUP="tty", MODE="0660"
|
||||
9
sci-geosciences/gpsd/files/99-gpsd-usb.rules
Normal file
9
sci-geosciences/gpsd/files/99-gpsd-usb.rules
Normal file
@@ -0,0 +1,9 @@
|
||||
# udev rules for the gpsd USB hotplugging (without hotplug)
|
||||
|
||||
SUBSYSTEM!="tty", GOTO="gpsd-usb_rules_end"
|
||||
ACTION!="add", GOTO="gpsd-usb_rules_end"
|
||||
|
||||
KERNEL=="ttyUSB[0-9]*", SYMLINK="gps%n", RUN+="/etc/hotplug/usb/gpsd.hotplug add $root/%k"
|
||||
|
||||
LABEL="gpsd-usb_rules_end"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
If you try to add the same device twice with the hotplug script, gpsd does not
|
||||
send any error back to the script, leading to it waiting forever on recv(), and
|
||||
blocking gpsd from progressing in it's select loop.
|
||||
|
||||
This patch makes the daemon write back an error to the control socket (in
|
||||
addition the the normal debug output), so that the hotplug script does not
|
||||
block for the socket, and everything proceeds much better.
|
||||
|
||||
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
|
||||
|
||||
diff -Nuar --exclude '*~' gpsd-2.33.orig/gpsd.c gpsd-2.33/gpsd.c
|
||||
--- gpsd-2.33.orig/gpsd.c 2006-06-09 05:34:09.000000000 -0700
|
||||
+++ gpsd-2.33/gpsd.c 2006-08-13 15:42:25.152204904 -0700
|
||||
@@ -1048,9 +1048,10 @@
|
||||
(void)write(sfd, "ERROR\n", 6);
|
||||
} else if (buf[0] == '+') {
|
||||
p = snarfline(buf+1, &stash);
|
||||
- if (find_device(stash))
|
||||
+ if (find_device(stash)) {
|
||||
gpsd_report(1,"<= control(%d): %s already active \n", sfd, stash);
|
||||
- else {
|
||||
+ (void)write(sfd, "ERROR\n", 6);
|
||||
+ } else {
|
||||
gpsd_report(1,"<= control(%d): adding %s \n", sfd, stash);
|
||||
if (open_device(stash))
|
||||
(void)write(sfd, "OK\n", 3);
|
||||
@@ -0,0 +1,54 @@
|
||||
In recent versions of udev, the gpsd script runs in series with the task that
|
||||
creates the real /dev/ttyUSB0 device node. Unfortuntely, the gpsd script runs
|
||||
BEFORE the creation of the node, and the node is not created until after you
|
||||
kill the gpsd script, because the gpsd script waits forever for the node to
|
||||
appear.
|
||||
|
||||
This is a race condition, and is best fixed by running the actual wait/hotplug
|
||||
portion in the background.
|
||||
|
||||
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
|
||||
|
||||
diff -Nuar --exclude '*~' gpsd-2.33.orig/gpsd.hotplug gpsd-2.33/gpsd.hotplug
|
||||
--- gpsd-2.33.orig/gpsd.hotplug 2005-06-27 11:53:00.000000000 -0700
|
||||
+++ gpsd-2.33/gpsd.hotplug 2006-08-13 18:35:03.382383884 -0700
|
||||
@@ -56,7 +56,7 @@
|
||||
return action
|
||||
|
||||
def hotplug(action, devpath):
|
||||
- #syslog.syslog("ACTION=%s" % action)
|
||||
+ #syslog.syslog("ACTION=%s DEVPATH=%s" % (action,devpath))
|
||||
if not devpath:
|
||||
syslog.syslog("No device")
|
||||
else:
|
||||
@@ -88,16 +88,18 @@
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
- syslog.openlog('gpsd.hotplug', 0, syslog.LOG_DAEMON)
|
||||
- try:
|
||||
- if len(sys.argv) == 1: # Called as hotplug script
|
||||
- hotplug(os.getenv("ACTION"), os.getenv("DEVPATH"))
|
||||
- else: # Called by hand for testing
|
||||
- gpsd_control(sys.argv[1], sys.argv[2])
|
||||
- except:
|
||||
- (exc_type, exc_value, exc_traceback) = sys.exc_info()
|
||||
- syslog.syslog("gpsd.hotplug: exception %s yields %s" % (exc_type, exc_value))
|
||||
- raise exc_type, exc_value, exc_traceback
|
||||
- #syslog.syslog("gpsd.hotplug ends")
|
||||
- syslog.closelog()
|
||||
+ pid = os.fork()
|
||||
+ if not pid:
|
||||
+ syslog.openlog('gpsd.hotplug', 0, syslog.LOG_DAEMON)
|
||||
+ try:
|
||||
+ if len(sys.argv) == 1: # Called as hotplug script
|
||||
+ hotplug(os.getenv("ACTION"), os.getenv("DEVPATH"))
|
||||
+ else: # Called by hand for testing
|
||||
+ gpsd_control(sys.argv[1], sys.argv[2])
|
||||
+ except:
|
||||
+ (exc_type, exc_value, exc_traceback) = sys.exc_info()
|
||||
+ syslog.syslog("gpsd.hotplug: exception %s yields %s" % (exc_type, exc_value))
|
||||
+ raise exc_type, exc_value, exc_traceback
|
||||
+ #syslog.syslog("gpsd.hotplug ends")
|
||||
+ syslog.closelog()
|
||||
|
||||
28
sci-geosciences/gpsd/files/gpsd.conf
Normal file
28
sci-geosciences/gpsd/files/gpsd.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
# Copyright 1999-2005 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpsd/files/gpsd.conf,v 1.6 2008/02/23 20:03:59 nerdboy Exp $
|
||||
|
||||
# Config file for gpsd server
|
||||
|
||||
# ATTENTION: most of the configuration is done in the kernel device
|
||||
# setup for USB/Serial, Garmin, or other, however, without hotplug,
|
||||
# gpsd still needs to have the device set on the commandline.
|
||||
|
||||
# Set GPS_DEV to the device to be used by the gpsd server.
|
||||
# This device must have the group tty and be writable (see
|
||||
# the INSTALL file in the docs).
|
||||
|
||||
# This example is for a Deluo GPS Serial/USB converter dongle, really
|
||||
# a pl2303 chip - CONFIG_USB_SERIAL_PL2303 in modern 2.6 kernels.
|
||||
# The normal udev config provides the correct /dev/ttyUSB0 device.
|
||||
# The second example is just a normal serial port...
|
||||
|
||||
#GPS_DEV="/dev/ttyUSB0"
|
||||
|
||||
#GPS_DEV="/dev/ttyS0
|
||||
|
||||
# Use the following for gpsd with ntp instead of the older one below
|
||||
#GPSD_OPTS="-n ${GPS_DEV}"
|
||||
|
||||
GPSD_OPTS="-P /var/run/gpsd.pid -f GPS0 -F /var/run/gpsd.sock"
|
||||
|
||||
35
sci-geosciences/gpsd/files/gpsd.init
Executable file
35
sci-geosciences/gpsd/files/gpsd.init
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2004 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpsd/files/gpsd.init,v 1.6 2007/06/11 03:04:29 nerdboy Exp $
|
||||
|
||||
# You can use this init script to manage a serial port GPS or other
|
||||
# non-hotplug device (or any device for that matter). By design,
|
||||
# USB devices should use the hotplug script instead.
|
||||
|
||||
depend() {
|
||||
after serial hotplug dbus bluetooth
|
||||
before ntpd
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
if [ -z "${GPS_DEV}" ]; then
|
||||
eerror "You must define GPS_DEV in /etc/conf.d/gpsd."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return 1
|
||||
ebegin "Starting gpsd"
|
||||
touch /var/run/gpsd.pid
|
||||
/usr/sbin/gpsd ${GPSD_OPTS} ${GPS_DEV}
|
||||
eend $? "Failed to start gpsd"
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping gpsd"
|
||||
killall -q gpsd >/dev/null
|
||||
eend $? "Failed to stop gpsd"
|
||||
rm -f /var/run/gpsd.pid
|
||||
}
|
||||
Reference in New Issue
Block a user