From c98b2f82a4e532ca61592b08e3ad60749eb9f8d7 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 8 Mar 2002 21:12:35 +0000 Subject: Initial revision --- scripts/Makefile.am | 18 ++++ scripts/Makefile.in | 227 ++++++++++++++++++++++++++++++++++++++++++++++++ scripts/bluepin | 148 +++++++++++++++++++++++++++++++ scripts/bluetooth.rc.rh | 72 +++++++++++++++ 4 files changed, 465 insertions(+) create mode 100644 scripts/Makefile.am create mode 100644 scripts/Makefile.in create mode 100755 scripts/bluepin create mode 100755 scripts/bluetooth.rc.rh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 00000000..12f32c78 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,18 @@ +# +# $Id$ +# + +bin_SCRIPTS = bluepin + +install-data-local: @DISTRO@ + +unknown: + -echo Unknown distribution + +redhat: + $(mkinstalldirs) $(DESTDIR)/etc/rc.d/init.d + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/rc.d/init.d/bluetooth + +debian: + $(mkinstalldirs) $(DESTDIR)/etc/init.d + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/init.d/bluetooth diff --git a/scripts/Makefile.in b/scripts/Makefile.in new file mode 100644 index 00000000..d750a69c --- /dev/null +++ b/scripts/Makefile.in @@ -0,0 +1,227 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# $Id$ +# + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +AR = @AR@ +AWK = @AWK@ +CC = @CC@ +DISTRO = @DISTRO@ +GLIB = @GLIB@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LDFLAGS = @GLIB_LDFLAGS@ +LD = @LD@ +LEX = @LEX@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +PCMCIA = @PCMCIA@ +VERSION = @VERSION@ +YACC = @YACC@ + +bin_SCRIPTS = bluepin +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +SCRIPTS = $(bin_SCRIPTS) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + else if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + else :; fi; fi; \ + done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + list='$(bin_SCRIPTS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = scripts + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu scripts/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binSCRIPTS +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binSCRIPTS +uninstall: uninstall-am +all-am: Makefile $(SCRIPTS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-binSCRIPTS install-binSCRIPTS tags distdir info-am \ +info dvi-am dvi check check-am installcheck-am installcheck \ +install-exec-am install-exec install-data-local install-data-am \ +install-data install-am install uninstall-am uninstall all-redirect \ +all-am all installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +install-data-local: @DISTRO@ + +unknown: + -echo Unknown distribution + +redhat: + $(mkinstalldirs) $(DESTDIR)/etc/rc.d/init.d + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/rc.d/init.d/bluetooth + +debian: + $(mkinstalldirs) $(DESTDIR)/etc/init.d + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/init.d/bluetooth + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/scripts/bluepin b/scripts/bluepin new file mode 100755 index 00000000..db1f8196 --- /dev/null +++ b/scripts/bluepin @@ -0,0 +1,148 @@ +#!/usr/bin/python +# +# Bluetooth PIN helper +# Written by Maxim Krasnyansky +# + +import sys, os, string + +# +# FIXME: +# +# We have to find actual user and proper X display here. And if +# it's not available (no one's logged in) we should lookup some +# file for predefined PINs. +# +# For now we just assume that we have access to local X display +# and whoever is logged in there will get a window pop. +# + +os.environ['DISPLAY'] = ':0' + +# For X Window display access blueping has to find a user and use +# his(her) .Xauthority file. +# os.environ['XAUTHORITY'] = '/home/maxk/.Xauthority' + +from gtk import * +#import GdkImlib, GtkExtra + +# Dialog Class +DLG_OK = 1 +DLG_CANCEL = 2 +class Dialog(GtkDialog): + result = DLG_CANCEL + args = {} + def __init__(self, modal=FALSE, mesg=None, args = {}): + GtkDialog.__init__(self) + self.args = args + self.set_modal(modal) + self.set_usize(400, 0) + self.set_uposition(300,300) + + self.connect("destroy", self.quit) + self.connect("delete_event", self.quit) + + self.action_area.set_border_width(2) + + ok = GtkButton("Accept") + ok.connect("clicked", self.ok) + self.action_area.pack_start(ok, padding = 20) + ok.show() + + cl = GtkButton("Reject") + cl.connect("clicked", self.cancel) + self.action_area.pack_start(cl, padding = 20) + cl.show() + + if mesg: + msg = GtkLabel() + msg.set_text(mesg) + self.vbox.pack_start(msg, padding = 10) + msg.show() + + self.ents = [] + for k in self.args.keys(): + hbox = GtkHBox() + hbox.set_border_width(5) + self.vbox.pack_start(hbox) + hbox.show() + + l = GtkLabel() + e = GtkEntry() + l.set_text( k ) + e.set_text( self.args[k] ) + e.connect("key_press_event", self.key_press) + hbox.pack_start(l, padding = 10, expand = FALSE) + hbox.pack_start(e) + l.show() + e.show() + + self.ents.append( (k, e) ) + + self.ents[0][1].grab_focus() + + def key_press(self, entry, event): + if event.keyval == GDK.Return: + entry.emit_stop_by_name("key_press_event") + self.ok() + elif event.keyval == GDK.Escape: + entry.emit_stop_by_name("key_press_event") + self.cancel() + + def ok(self, *args): + self.result = DLG_OK + for e in self.ents: + k = e[0] + self.args[k] = e[1].get_text() + self.quit() + + def cancel(self, *args): + self.result = DLG_CANCEL + self.quit() + + def quit(self, *args): + self.hide() + self.destroy() + mainquit() + +def dialog(title, mesg, args, modal = FALSE): + dlg = Dialog(args = args, mesg = mesg, modal = modal) + dlg.set_title(title) + dlg.show() + mainloop() + return dlg.result + +def main(*args): + dir = sys.argv[1] + bdaddr = sys.argv[2] + + if len(sys.argv) > 3: + name = sys.argv[3] + else: + name = "" + + title = "Bluetooth PIN Code" + + # Bluetooth spec recommends automatic strong random PIN generation. + # So eventually we should implement that. + pin = { "PIN": "" } + + if dir == "out": + mesg = "Outgoing connection to " + else: + mesg = "Incomming connection from " + + mesg = mesg + name + "[" + bdaddr + "]" + + if dialog(title, mesg, pin) == DLG_OK: + pin["PIN"] = string.strip(pin["PIN"]) + + if len(pin["PIN"]) >= 4 and len(pin["PIN"]) <=16: + print "PIN:" + pin["PIN"] + else: + print "ERR" + else: + print "ERR" + +# +main() diff --git a/scripts/bluetooth.rc.rh b/scripts/bluetooth.rc.rh new file mode 100755 index 00000000..f0586788 --- /dev/null +++ b/scripts/bluetooth.rc.rh @@ -0,0 +1,72 @@ +#!/bin/sh +# +# bluetooth Bluetooth subsystem starting and stopping +# +# chkconfig: 345 25 90 +# description: Bluetooth subsystem +# + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source Bluetooth configuration. +#. /etc/sysconfig/bluetooth + +prog="Bluetooth" + +UART_CONF="/etc/bluetooth/uart" + +start_uarts() +{ + [ -f /sbin/hciattach -a -f $UART_CONF ] || return + grep -v '^#' $UART_CONF | while read i; do + /sbin/hciattach $i + done +} + +stop_uarts() +{ + killproc hciattach > /dev/null 2>&1 +} + +start() +{ + echo -n $"Starting $prog: " + daemon /sbin/hcid + start_uarts + touch /var/lock/subsys/bluetooth + echo +} + +stop() +{ + echo -n $"Shutting down $prog: " + stop_uarts + killproc hcid + rm -f /var/lock/subsys/bluetooth + echo +} + +[ -f /sbin/hcid ] || exit 0 + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + ;; + condrestart) + [ -e /var/lock/subsys/bluetooth ] && (stop; start) + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart}" + exit 1 +esac + +exit 0 -- cgit From 386647e4e954416f41107db5438223193e8e9167 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 15 Apr 2002 16:53:01 +0000 Subject: Working X display and authentication setting --- scripts/bluepin | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index db1f8196..a1c51ab2 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -3,28 +3,34 @@ # Bluetooth PIN helper # Written by Maxim Krasnyansky # +import sys, os, string, popen2 -import sys, os, string - -# -# FIXME: -# -# We have to find actual user and proper X display here. And if -# it's not available (no one's logged in) we should lookup some -# file for predefined PINs. -# -# For now we just assume that we have access to local X display -# and whoever is logged in there will get a window pop. +# X Display initialization. +# Find running X Server and parse it's arguments. +# Set enviroment variables DISPLAY and XAUTHORITY +# using info extracted from X Server args. # - -os.environ['DISPLAY'] = ':0' - -# For X Window display access blueping has to find a user and use -# his(her) .Xauthority file. -# os.environ['XAUTHORITY'] = '/home/maxk/.Xauthority' +def set_display(): + disp = ":0" + auth = "" + ps = "/bin/ps -C X --format args --no-headers" + + r,w = popen2.popen2(ps) + arg = string.split(r.read()) + for i in range(1, len(arg)): + if arg[i][0] != '-': + disp = arg[i] + elif arg[i] == "-auth": + auth = arg[i+1] + break + + os.environ['DISPLAY'] = disp + os.environ['XAUTHORITY'] = auth + +# Set X display before initializing GTK +set_display() from gtk import * -#import GdkImlib, GtkExtra # Dialog Class DLG_OK = 1 @@ -113,6 +119,10 @@ def dialog(title, mesg, args, modal = FALSE): return dlg.result def main(*args): + if len(sys.argv) < 2: + print "ERR" + sys.exit() + dir = sys.argv[1] bdaddr = sys.argv[2] -- cgit From bcdc3df71560286f08ca6fae865a8aaad1a16ed3 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 16 Apr 2002 22:41:17 +0000 Subject: X server args parsing fix --- scripts/bluepin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index a1c51ab2..6246283e 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -18,7 +18,7 @@ def set_display(): r,w = popen2.popen2(ps) arg = string.split(r.read()) for i in range(1, len(arg)): - if arg[i][0] != '-': + if arg[i][0] != '-' and i==1: disp = arg[i] elif arg[i] == "-auth": auth = arg[i+1] -- cgit From 79095069d348e61dc26c6fa6e35428c5d90887ff Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 3 May 2002 22:15:02 +0000 Subject: Bluetooth rc script for Debian distro. --- scripts/Makefile.am | 2 +- scripts/Makefile.in | 2 +- scripts/bluetooth.rc.deb | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100755 scripts/bluetooth.rc.deb (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 12f32c78..117c3186 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -15,4 +15,4 @@ redhat: debian: $(mkinstalldirs) $(DESTDIR)/etc/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/init.d/bluetooth + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)/etc/init.d/bluetooth diff --git a/scripts/Makefile.in b/scripts/Makefile.in index d750a69c..ccc6f79f 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -220,7 +220,7 @@ redhat: debian: $(mkinstalldirs) $(DESTDIR)/etc/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/init.d/bluetooth + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)/etc/init.d/bluetooth # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/scripts/bluetooth.rc.deb b/scripts/bluetooth.rc.deb new file mode 100755 index 00000000..36892187 --- /dev/null +++ b/scripts/bluetooth.rc.deb @@ -0,0 +1,60 @@ +#! /bin/sh +# +# bluetooth Bluetooth subsystem starting and stopping +# +# Edd Dumbill + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/sbin/hcid +HCIATTACH=/sbin/hciattach +UART_CONF=/etc/bluetooth/uart +NAME=hcid +DESC=bluez-utils + +test -f $DAEMON || exit 0 +test -f $HCIATTACH || exit 0 + +set -e + +start_uarts() +{ + [ -f $HCIATTACH -a -f $UART_CONF ] || return + grep -v '^#' $UART_CONF | while read i; do + $HCIATTACH $i + done +} + +stop_uarts() +{ + killall hciattach > /dev/null 2>&1 || true +} + +case "$1" in + start) + echo -n "Starting $DESC: " + $DAEMON + echo "$NAME." + start_uarts || true + ;; + stop) + echo -n "Stopping $DESC: " + killall $NAME || true + echo "$NAME." + stop_uarts + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + killall $NAME || true + sleep 1 + $DAEMON + echo "$NAME." + ;; + *) + N=/etc/init.d/bluez-utils + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 -- cgit From 6524a7f07a5b73e2b34a5b8feeb8b4c4ff1fd385 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 9 May 2002 16:31:11 +0000 Subject: Add XFree86 to the list X servers that we look for. --- scripts/bluepin | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index 6246283e..aa1a0f3c 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -11,9 +11,10 @@ import sys, os, string, popen2 # using info extracted from X Server args. # def set_display(): - disp = ":0" + disp = ":0" auth = "" - ps = "/bin/ps -C X --format args --no-headers" + proc = "-C X -C XFree86" + ps = "/bin/ps " + proc + " --format args --no-headers" r,w = popen2.popen2(ps) arg = string.split(r.read()) -- cgit From c7057958d5fbf7fa82745b5ab75844723def24ab Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 17 May 2002 01:01:13 +0000 Subject: Fix "make dist". --- scripts/Makefile.am | 2 ++ scripts/Makefile.in | 2 ++ 2 files changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 117c3186..4d86094a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -4,6 +4,8 @@ bin_SCRIPTS = bluepin +EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb + install-data-local: @DISTRO@ unknown: diff --git a/scripts/Makefile.in b/scripts/Makefile.in index ccc6f79f..a6e9f552 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -83,6 +83,8 @@ VERSION = @VERSION@ YACC = @YACC@ bin_SCRIPTS = bluepin + +EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = SCRIPTS = $(bin_SCRIPTS) -- cgit From e4108aa9ba79bc6e898fa1581e2c4a56a68ad10d Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 23 May 2002 20:57:19 +0000 Subject: Build env cleanup. Remove auto generated files from CVS. Working 'make distcheck'. --- scripts/Makefile.in | 229 ---------------------------------------------------- 1 file changed, 229 deletions(-) delete mode 100644 scripts/Makefile.in (limited to 'scripts') diff --git a/scripts/Makefile.in b/scripts/Makefile.in deleted file mode 100644 index a6e9f552..00000000 --- a/scripts/Makefile.in +++ /dev/null @@ -1,229 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -# $Id$ -# - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AWK = @AWK@ -CC = @CC@ -DISTRO = @DISTRO@ -GLIB = @GLIB@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LDFLAGS = @GLIB_LDFLAGS@ -LD = @LD@ -LEX = @LEX@ -MAKEINFO = @MAKEINFO@ -PACKAGE = @PACKAGE@ -PCMCIA = @PCMCIA@ -VERSION = @VERSION@ -YACC = @YACC@ - -bin_SCRIPTS = bluepin - -EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -SCRIPTS = $(bin_SCRIPTS) - -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - else :; fi; fi; \ - done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - list='$(bin_SCRIPTS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - done -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = scripts - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu scripts/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: install-binSCRIPTS -install-exec: install-exec-am - -install-data-am: install-data-local -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-binSCRIPTS -uninstall: uninstall-am -all-am: Makefile $(SCRIPTS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-generic clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: uninstall-binSCRIPTS install-binSCRIPTS tags distdir info-am \ -info dvi-am dvi check check-am installcheck-am installcheck \ -install-exec-am install-exec install-data-local install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all installdirs mostlyclean-generic distclean-generic \ -clean-generic maintainer-clean-generic clean mostlyclean distclean \ -maintainer-clean - - -install-data-local: @DISTRO@ - -unknown: - -echo Unknown distribution - -redhat: - $(mkinstalldirs) $(DESTDIR)/etc/rc.d/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/rc.d/init.d/bluetooth - -debian: - $(mkinstalldirs) $(DESTDIR)/etc/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)/etc/init.d/bluetooth - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: -- cgit From 00b80c5e59ee6375af4a06b41f181d2d90402ad8 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 24 Jun 2002 03:11:13 +0000 Subject: Start sdpd, if installed. --- scripts/bluetooth.rc.rh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.rc.rh b/scripts/bluetooth.rc.rh index f0586788..95ae4222 100755 --- a/scripts/bluetooth.rc.rh +++ b/scripts/bluetooth.rc.rh @@ -16,7 +16,7 @@ prog="Bluetooth" UART_CONF="/etc/bluetooth/uart" -start_uarts() +start_uarts() { [ -f /sbin/hciattach -a -f $UART_CONF ] || return grep -v '^#' $UART_CONF | while read i; do @@ -33,16 +33,26 @@ start() { echo -n $"Starting $prog: " daemon /sbin/hcid + + if [ -x /usr/sbin/sdpd ]; then + daemon /usr/sbin/sdpd + fi + start_uarts - touch /var/lock/subsys/bluetooth + touch /var/lock/subsys/bluetooth echo } stop() { echo -n $"Shutting down $prog: " - stop_uarts killproc hcid + + if [ -x /usr/sbin/sdpd ]; then + killproc sdpd + fi + + stop_uarts rm -f /var/lock/subsys/bluetooth echo } -- cgit From 13c90373161dea879719e09696d6dc6141465264 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 15 Jan 2003 13:08:16 +0000 Subject: Add the create_dev script --- scripts/Makefile.am | 2 +- scripts/create_dev | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 scripts/create_dev (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4d86094a..812f160a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -4,7 +4,7 @@ bin_SCRIPTS = bluepin -EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb +EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb create_dev install-data-local: @DISTRO@ diff --git a/scripts/create_dev b/scripts/create_dev new file mode 100755 index 00000000..4ea0c263 --- /dev/null +++ b/scripts/create_dev @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Create Bluetooth devices in /dev +# +# $Id$ +# + +VHCI_MAJOR=10 +VHCI_MINOR=250 + +RFCOMM_MAJOR=216 + +# +# Create device for VHCI +# +if [ ! -c /dev/vhci ]; then + mknod /dev/vhci c ${VHCI_MAJOR} ${VHCI_MINOR} + chmod 664 /dev/vhci +fi + +# +# Create devices for RFCOMM +# +for i in `seq 0 255` +do + if [ ! -c /dev/rfcomm$i ]; then + mknod -m 666 /dev/rfcomm$i c ${RFCOMM_MAJOR} $i + fi +done -- cgit From 495f345e287c55e16ac5c868485806d2edb2356f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 9 Feb 2003 11:34:06 +0000 Subject: New boot script for Debian --- scripts/bluetooth.rc.deb | 76 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 25 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.rc.deb b/scripts/bluetooth.rc.deb index 36892187..2480d385 100755 --- a/scripts/bluetooth.rc.deb +++ b/scripts/bluetooth.rc.deb @@ -1,57 +1,83 @@ #! /bin/sh # -# bluetooth Bluetooth subsystem starting and stopping +# bluetooth Bluetooth subsystem starting and stopping # -# Edd Dumbill +NAME=bluetooth +DESC="Bluetooth subsystem" PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/sbin/hcid +HCID=/sbin/hcid +HCID_CONF=/etc/bluetooth/hcid.conf HCIATTACH=/sbin/hciattach UART_CONF=/etc/bluetooth/uart -NAME=hcid -DESC=bluez-utils - -test -f $DAEMON || exit 0 -test -f $HCIATTACH || exit 0 +SDPD=/usr/sbin/sdpd +RFCOMM=/bin/rfcomm +RFCOMM_CONF=/etc/bluetooth/rfcomm.conf set -e start_uarts() { - [ -f $HCIATTACH -a -f $UART_CONF ] || return - grep -v '^#' $UART_CONF | while read i; do - $HCIATTACH $i - done + [ -x $HCIATTACH -a -f $UART_CONF ] || return + grep -v '^#' $UART_CONF | while read i; do + $HCIATTACH $i + done } stop_uarts() { - killall hciattach > /dev/null 2>&1 || true + killall $HCIATTACH > /dev/null 2>&1 || true } case "$1" in start) - echo -n "Starting $DESC: " - $DAEMON - echo "$NAME." + echo -n "Starting $DESC:" + if [ -x $HCID -a -f $HCID_CONF ] ; then + $HCID -f $HCID_CONF + echo -n " hcid" + fi + if [ -x $SDPD ] ; then + $SDPD + echo -n " sdpd" + fi + if [ -x $RFCOMM -a -f $RFCOMM_CONF ] ; then + $RFCOMM -f $RFCOMM_CONF bind all + echo -n " rfcomm" + fi + echo "." start_uarts || true ;; stop) - echo -n "Stopping $DESC: " - killall $NAME || true - echo "$NAME." + echo -n "Stopping $DESC:" + if [ -x $RFCOMM ] ; then + echo -n " rfcomm" + $RFCOMM unbind all + fi + echo -n " sdpd" + killall $SDPD > /dev/null 2>&1 || true + echo -n " hcid" + killall $HCID > /dev/null 2>&1 || true + echo "." stop_uarts ;; restart|force-reload) - echo -n "Restarting $DESC: " - killall $NAME || true + echo -n "Restarting $DESC:" + echo -n " hcid" + killall $HCID > /dev/null 2>&1 || true + sleep 1 + if [ -x $HCID -a -f $HCID_CONF ] ; then + $HCID -f $HCID_CONF + fi + echo -n " sdpd" + killall $SDPD > /dev/null 2>&1 || true sleep 1 - $DAEMON - echo "$NAME." + if [ -x $SDPD ] ; then + $SDPD + fi + echo "." ;; *) - N=/etc/init.d/bluez-utils - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + N=/etc/init.d/bluetooth echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; -- cgit From e4be7ba24dd532b782e60ff7d3bcdfd87989cc37 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 10 Feb 2003 15:34:55 +0000 Subject: fix typo --- scripts/bluepin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index aa1a0f3c..b17f4a03 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -141,7 +141,7 @@ def main(*args): if dir == "out": mesg = "Outgoing connection to " else: - mesg = "Incomming connection from " + mesg = "Incoming connection from " mesg = mesg + name + "[" + bdaddr + "]" -- cgit From a5a51aaf5fd8de7903e3f14d65452c30eb2f837f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 15 Apr 2003 19:37:48 +0000 Subject: Update of the init scripts --- scripts/bluetooth.rc.deb | 2 +- scripts/bluetooth.rc.rh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluetooth.rc.deb b/scripts/bluetooth.rc.deb index 2480d385..01ae1b56 100755 --- a/scripts/bluetooth.rc.deb +++ b/scripts/bluetooth.rc.deb @@ -51,7 +51,7 @@ case "$1" in echo -n "Stopping $DESC:" if [ -x $RFCOMM ] ; then echo -n " rfcomm" - $RFCOMM unbind all + $RFCOMM release all fi echo -n " sdpd" killall $SDPD > /dev/null 2>&1 || true diff --git a/scripts/bluetooth.rc.rh b/scripts/bluetooth.rc.rh index 95ae4222..c8560946 100755 --- a/scripts/bluetooth.rc.rh +++ b/scripts/bluetooth.rc.rh @@ -38,6 +38,10 @@ start() daemon /usr/sbin/sdpd fi + if [ -x /bin/rfcomm -a -f /etc/bluetooth/rfcomm.conf ]; then + /bin/rfcomm -f /etc/bluetooth/rfcomm.conf bind all + fi + start_uarts touch /var/lock/subsys/bluetooth echo @@ -52,6 +56,10 @@ stop() killproc sdpd fi + if [ -x /bin/rfcomm ]; then + /bin/rfcomm release all + fi + stop_uarts rm -f /var/lock/subsys/bluetooth echo -- cgit From cf68ecb96dba46e75fd03df9407fc9d8d9b07efb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 30 Apr 2003 21:03:18 +0000 Subject: Allow PIN length from 1 to 16 --- scripts/bluepin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index b17f4a03..66eec987 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -148,7 +148,7 @@ def main(*args): if dialog(title, mesg, pin) == DLG_OK: pin["PIN"] = string.strip(pin["PIN"]) - if len(pin["PIN"]) >= 4 and len(pin["PIN"]) <=16: + if len(pin["PIN"]) >= 1 and len(pin["PIN"]) <= 16: print "PIN:" + pin["PIN"] else: print "ERR" -- cgit From e1d0ebd7b44b29e9ef54ec98f07c42c01e2fd173 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Mar 2004 23:14:00 +0000 Subject: Update bluepin script for GTK2 --- scripts/bluepin | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index 66eec987..607facba 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -3,11 +3,13 @@ # Bluetooth PIN helper # Written by Maxim Krasnyansky # -import sys, os, string, popen2 +import sys, os, string, popen2, pygtk + +pygtk.require('2.0') # X Display initialization. -# Find running X Server and parse it's arguments. -# Set enviroment variables DISPLAY and XAUTHORITY +# Find running X Server and parse its arguments. +# Set environment variables DISPLAY and XAUTHORITY # using info extracted from X Server args. # def set_display(): @@ -31,55 +33,58 @@ def set_display(): # Set X display before initializing GTK set_display() -from gtk import * +# Some versions of fontconfig will segfault if HOME isn't set. +os.environ['HOME'] = "" + +import gtk # Dialog Class DLG_OK = 1 DLG_CANCEL = 2 -class Dialog(GtkDialog): +class Dialog(gtk.Dialog): result = DLG_CANCEL args = {} - def __init__(self, modal=FALSE, mesg=None, args = {}): - GtkDialog.__init__(self) + def __init__(self, modal=gtk.FALSE, mesg=None, args = {}): + gtk.Dialog.__init__(self) self.args = args self.set_modal(modal) - self.set_usize(400, 0) - self.set_uposition(300,300) +# self.set_usize(400, 0) +# self.set_uposition(300,300) self.connect("destroy", self.quit) self.connect("delete_event", self.quit) self.action_area.set_border_width(2) - ok = GtkButton("Accept") + ok = gtk.Button("Accept") ok.connect("clicked", self.ok) self.action_area.pack_start(ok, padding = 20) ok.show() - cl = GtkButton("Reject") + cl = gtk.Button("Reject") cl.connect("clicked", self.cancel) self.action_area.pack_start(cl, padding = 20) cl.show() if mesg: - msg = GtkLabel() + msg = gtk.Label("") msg.set_text(mesg) self.vbox.pack_start(msg, padding = 10) msg.show() self.ents = [] for k in self.args.keys(): - hbox = GtkHBox() + hbox = gtk.HBox() hbox.set_border_width(5) self.vbox.pack_start(hbox) hbox.show() - l = GtkLabel() - e = GtkEntry() + l = gtk.Label("") + e = gtk.Entry() l.set_text( k ) e.set_text( self.args[k] ) e.connect("key_press_event", self.key_press) - hbox.pack_start(l, padding = 10, expand = FALSE) + hbox.pack_start(l, padding = 10, expand = gtk.FALSE) hbox.pack_start(e) l.show() e.show() @@ -89,10 +94,10 @@ class Dialog(GtkDialog): self.ents[0][1].grab_focus() def key_press(self, entry, event): - if event.keyval == GDK.Return: + if event.keyval == gtk.keysyms.Return: entry.emit_stop_by_name("key_press_event") self.ok() - elif event.keyval == GDK.Escape: + elif event.keyval == gtk.keysyms.Escape: entry.emit_stop_by_name("key_press_event") self.cancel() @@ -110,13 +115,13 @@ class Dialog(GtkDialog): def quit(self, *args): self.hide() self.destroy() - mainquit() + gtk.mainquit() -def dialog(title, mesg, args, modal = FALSE): +def dialog(title, mesg, args, modal = gtk.FALSE): dlg = Dialog(args = args, mesg = mesg, modal = modal) dlg.set_title(title) dlg.show() - mainloop() + gtk.mainloop() return dlg.result def main(*args): -- cgit From 32c5dbc2343b258dd9f6f59ab69cdf0b958b5e2c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 20:39:30 +0000 Subject: Correct the path for sdpd --- scripts/bluetooth.rc.deb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluetooth.rc.deb b/scripts/bluetooth.rc.deb index 01ae1b56..b0b6dc8c 100755 --- a/scripts/bluetooth.rc.deb +++ b/scripts/bluetooth.rc.deb @@ -10,7 +10,7 @@ HCID=/sbin/hcid HCID_CONF=/etc/bluetooth/hcid.conf HCIATTACH=/sbin/hciattach UART_CONF=/etc/bluetooth/uart -SDPD=/usr/sbin/sdpd +SDPD=/sbin/sdpd RFCOMM=/bin/rfcomm RFCOMM_CONF=/etc/bluetooth/rfcomm.conf -- cgit From 645b703bed7a352838451e5ca934c605fafebfec Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 21:28:40 +0000 Subject: Change default prefix to /usr --- scripts/bluetooth.rc.deb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.rc.deb b/scripts/bluetooth.rc.deb index b0b6dc8c..4c216c31 100755 --- a/scripts/bluetooth.rc.deb +++ b/scripts/bluetooth.rc.deb @@ -6,12 +6,12 @@ NAME=bluetooth DESC="Bluetooth subsystem" PATH=/sbin:/bin:/usr/sbin:/usr/bin -HCID=/sbin/hcid +HCID=/usr/sbin/hcid HCID_CONF=/etc/bluetooth/hcid.conf -HCIATTACH=/sbin/hciattach +HCIATTACH=/usr/sbin/hciattach UART_CONF=/etc/bluetooth/uart -SDPD=/sbin/sdpd -RFCOMM=/bin/rfcomm +SDPD=/usr/sbin/sdpd +RFCOMM=/usr/bin/rfcomm RFCOMM_CONF=/etc/bluetooth/rfcomm.conf set -e -- cgit From a5b3f19c5d1722fa60ce5ab423be81c85c6bbc54 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 22:37:52 +0000 Subject: Make use of $(sysconfdir) --- scripts/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 812f160a..8c6e56d2 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -12,9 +12,9 @@ unknown: -echo Unknown distribution redhat: - $(mkinstalldirs) $(DESTDIR)/etc/rc.d/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)/etc/rc.d/init.d/bluetooth + $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/rc.d/init.d + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)$(sysconfdir)/rc.d/init.d/bluetooth debian: - $(mkinstalldirs) $(DESTDIR)/etc/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)/etc/init.d/bluetooth + $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d + $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)$(sysconfdir)/init.d/bluetooth -- cgit From fc97038015af1e86b5daa8880ee36d0fbfa9ed6b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 09:51:21 +0000 Subject: Simplify init script installation --- scripts/Makefile.am | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 8c6e56d2..8e05086b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -4,17 +4,10 @@ bin_SCRIPTS = bluepin -EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb create_dev +EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb create_dev -install-data-local: @DISTRO@ - -unknown: - -echo Unknown distribution - -redhat: - $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/rc.d/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)$(sysconfdir)/rc.d/init.d/bluetooth - -debian: - $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d - $(INSTALL) -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)$(sysconfdir)/init.d/bluetooth +install-data-local: + [ ! -f /etc/redhat-release -o ! -f /etc/mandrake-release ] || \ + $(INSTALL) -D -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)$(sysconfdir)/rc.d/init.d/bluetooth + [ ! -f /etc/debian_version ] || \ + $(INSTALL) -D -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)$(sysconfdir)/init.d/bluetooth -- cgit From 6e58cec633c1a73ab11a2720dff4da094070b6f6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 28 Apr 2004 10:23:02 +0000 Subject: Add new Bluetooth init.d script --- scripts/bluetooth.default | 34 ++++++++++++++++ scripts/bluetooth.init | 102 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 scripts/bluetooth.default create mode 100644 scripts/bluetooth.init (limited to 'scripts') diff --git a/scripts/bluetooth.default b/scripts/bluetooth.default new file mode 100644 index 00000000..d96342c6 --- /dev/null +++ b/scripts/bluetooth.default @@ -0,0 +1,34 @@ +# Bluetooth configuraton file + +# Start of hcid (allowed values are "true" and "false") +HCID_ENABLE=true + +# Config file for hcid +HCID_CONFIG="/etc/bluetooth/hcid.conf" + +# Start sdpd (allowed values are "true" and "false") +SDPD_ENABLE=true + +# Start hidd (allowed values are "true" and "false") +HIDD_ENABLE=true + +# Run hid2hci (allowed values are "true" and "false") +HID2HCI_ENABLE=true + +# Bind rfcomm devices (allowed values are "true" and "false") +RFCOMM_ENABLE=true + +# Config file for rfcomm +RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" + +# Start dund (allowed values are "true" and "false") +DUND_ENABLE=false + +# Arguments to dund +DUND_OPTIONS="--listen --persist" + +# Start pand (allowed values are "true" and "false") +PAND_ENABLE=false + +# Arguments to pand +PAND_OPTIONS="--listen --role NAP" diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init new file mode 100644 index 00000000..d0b053cf --- /dev/null +++ b/scripts/bluetooth.init @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Start/stop the Bluetooth daemons +# + +set -e + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +NAME=bluetooth +DESC="Bluetooth subsystem" + +HCID_NAME=hcid +SDPD_NAME=sdpd +HIDD_NAME=hidd +HID2HCI_NAME=hid2hci +RFCOMM_NAME=rfcomm +PAND_NAME=pand +DUND_NAME=dund + +HCID_EXEC="`which $HCID_NAME || true`" +SDPD_EXEC="`which $SDPD_NAME || true`" +HIDD_EXEC="`which $HIDD_NAME || true`" +HID2HCI_EXEC="`which $HIDD_NAME || true`" +RFCOMM_EXEC="`which $RFCOMM_NAME || true`" +PAND_EXEC="`which $PAND_NAME || true`" +DUND_EXEC="`which $DUND_NAME || true`" + +HCID_ENABLE=true +SDPD_ENABLE=true +HIDD_ENABLE=false +HID2HCI_ENABLE=false +RFCOMM_ENABLE=true +DUND_ENABLE=false +PAND_ENABLE=false + +HCID_CONFIG="/etc/bluetooth/hcid.conf" +RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" + +DUND_OPTIONS="" +PAND_OPTIONS="" + +[ -e /etc/default/bluetooth ] && . /etc/default/bluetooth + +case "$1" in + start) + echo -n "Starting $DESC:" + if $HCID_ENABLE && [ -x "$HCID_EXEC" -a -f "$HCID_CONFIG" ] ; then + $HCID_EXEC -f $HCID_CONFIG + echo -n " $HCID_NAME" + fi + if $SDPD_ENABLE && [ -x "$SDPD_EXEC" ] ; then + $SDPD_EXEC + echo -n " $SDPD_NAME" + fi + if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then + $HIDD_EXEC --tohci + echo -n " $HIDD_NAME" + fi + if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then + $HID2HCI_EXEC + echo -n " $HID2HCI_NAME" + fi + if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] ; then + $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all + echo -n " $RFCOMM_NAME" + fi + if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; then + $DUND_EXEC $DUND_OPTIONS + echo -n " $DUND_NAME" + fi + if $PAND_ENABLE && [ -x "$PAND_EXEC" -a -n "$PAND_OPTIONS" ] ; then + $PAND_EXEC $PAND_OPTIONS + echo -n " $PAND_NAME" + fi + echo "." + ;; + stop) + echo -n "Stopping $DESC:" + killall $PAND_EXEC > /dev/null 2>&1 || true + echo -n " $PAND_NAME" + killall $DUND_EXEC > /dev/null 2>&1 || true + echo -n " $DUND_NAME" + if [ -x "$RFCOMM_EXEC" ] ; then + $RFCOMM_EXEC release all + echo -n " $RFCOMM_NAME" + fi + killall $HIDD_EXEC > /dev/null 2>&1 || true + echo -n " $HIDD_NAME" + killall $SDPD_EXEC > /dev/null 2>&1 || true + echo -n " $SDPD_NAME" + killall $HCID_EXEC > /dev/null 2>&1 || true + echo -n " $HCID_NAME" + echo "." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop}" >&2 + exit 1 + ;; +esac + +exit 0 -- cgit From 63acfaaadfcf85aaba0fb63b9a600d89819cd47b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 7 May 2004 17:51:28 +0000 Subject: Use one init.d script --- scripts/Makefile.am | 8 ++--- scripts/bluetooth.rc.deb | 86 --------------------------------------------- scripts/bluetooth.rc.rh | 90 ------------------------------------------------ 3 files changed, 3 insertions(+), 181 deletions(-) delete mode 100755 scripts/bluetooth.rc.deb delete mode 100755 scripts/bluetooth.rc.rh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 8e05086b..6130c842 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -4,10 +4,8 @@ bin_SCRIPTS = bluepin -EXTRA_DIST = bluepin bluetooth.rc.rh bluetooth.rc.deb create_dev +EXTRA_DIST = bluepin bluetooth.init bluetooth.default create_dev install-data-local: - [ ! -f /etc/redhat-release -o ! -f /etc/mandrake-release ] || \ - $(INSTALL) -D -m 755 $(srcdir)/bluetooth.rc.rh $(DESTDIR)$(sysconfdir)/rc.d/init.d/bluetooth - [ ! -f /etc/debian_version ] || \ - $(INSTALL) -D -m 755 $(srcdir)/bluetooth.rc.deb $(DESTDIR)$(sysconfdir)/init.d/bluetooth + $(INSTALL) -D -m 755 $(srcdir)/bluetooth.init $(DESTDIR)$(sysconfdir)/init.d/bluetooth + $(INSTALL) -D -m 644 $(srcdir)/bluetooth.default $(DESTDIR)$(sysconfdir)/default/bluetooth diff --git a/scripts/bluetooth.rc.deb b/scripts/bluetooth.rc.deb deleted file mode 100755 index 4c216c31..00000000 --- a/scripts/bluetooth.rc.deb +++ /dev/null @@ -1,86 +0,0 @@ -#! /bin/sh -# -# bluetooth Bluetooth subsystem starting and stopping -# - -NAME=bluetooth -DESC="Bluetooth subsystem" -PATH=/sbin:/bin:/usr/sbin:/usr/bin -HCID=/usr/sbin/hcid -HCID_CONF=/etc/bluetooth/hcid.conf -HCIATTACH=/usr/sbin/hciattach -UART_CONF=/etc/bluetooth/uart -SDPD=/usr/sbin/sdpd -RFCOMM=/usr/bin/rfcomm -RFCOMM_CONF=/etc/bluetooth/rfcomm.conf - -set -e - -start_uarts() -{ - [ -x $HCIATTACH -a -f $UART_CONF ] || return - grep -v '^#' $UART_CONF | while read i; do - $HCIATTACH $i - done -} - -stop_uarts() -{ - killall $HCIATTACH > /dev/null 2>&1 || true -} - -case "$1" in - start) - echo -n "Starting $DESC:" - if [ -x $HCID -a -f $HCID_CONF ] ; then - $HCID -f $HCID_CONF - echo -n " hcid" - fi - if [ -x $SDPD ] ; then - $SDPD - echo -n " sdpd" - fi - if [ -x $RFCOMM -a -f $RFCOMM_CONF ] ; then - $RFCOMM -f $RFCOMM_CONF bind all - echo -n " rfcomm" - fi - echo "." - start_uarts || true - ;; - stop) - echo -n "Stopping $DESC:" - if [ -x $RFCOMM ] ; then - echo -n " rfcomm" - $RFCOMM release all - fi - echo -n " sdpd" - killall $SDPD > /dev/null 2>&1 || true - echo -n " hcid" - killall $HCID > /dev/null 2>&1 || true - echo "." - stop_uarts - ;; - restart|force-reload) - echo -n "Restarting $DESC:" - echo -n " hcid" - killall $HCID > /dev/null 2>&1 || true - sleep 1 - if [ -x $HCID -a -f $HCID_CONF ] ; then - $HCID -f $HCID_CONF - fi - echo -n " sdpd" - killall $SDPD > /dev/null 2>&1 || true - sleep 1 - if [ -x $SDPD ] ; then - $SDPD - fi - echo "." - ;; - *) - N=/etc/init.d/bluetooth - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/scripts/bluetooth.rc.rh b/scripts/bluetooth.rc.rh deleted file mode 100755 index c8560946..00000000 --- a/scripts/bluetooth.rc.rh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# -# bluetooth Bluetooth subsystem starting and stopping -# -# chkconfig: 345 25 90 -# description: Bluetooth subsystem -# - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source Bluetooth configuration. -#. /etc/sysconfig/bluetooth - -prog="Bluetooth" - -UART_CONF="/etc/bluetooth/uart" - -start_uarts() -{ - [ -f /sbin/hciattach -a -f $UART_CONF ] || return - grep -v '^#' $UART_CONF | while read i; do - /sbin/hciattach $i - done -} - -stop_uarts() -{ - killproc hciattach > /dev/null 2>&1 -} - -start() -{ - echo -n $"Starting $prog: " - daemon /sbin/hcid - - if [ -x /usr/sbin/sdpd ]; then - daemon /usr/sbin/sdpd - fi - - if [ -x /bin/rfcomm -a -f /etc/bluetooth/rfcomm.conf ]; then - /bin/rfcomm -f /etc/bluetooth/rfcomm.conf bind all - fi - - start_uarts - touch /var/lock/subsys/bluetooth - echo -} - -stop() -{ - echo -n $"Shutting down $prog: " - killproc hcid - - if [ -x /usr/sbin/sdpd ]; then - killproc sdpd - fi - - if [ -x /bin/rfcomm ]; then - /bin/rfcomm release all - fi - - stop_uarts - rm -f /var/lock/subsys/bluetooth - echo -} - -[ -f /sbin/hcid ] || exit 0 - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - ;; - condrestart) - [ -e /var/lock/subsys/bluetooth ] && (stop; start) - ;; - *) - echo $"Usage: $0 {start|stop|restart|reload|condrestart}" - exit 1 -esac - -exit 0 -- cgit From 46db4df8662288a5282f52fe29d522142c021444 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 7 May 2004 17:57:42 +0000 Subject: Don't overwrite default file if it exists --- scripts/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6130c842..f375290c 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -8,4 +8,6 @@ EXTRA_DIST = bluepin bluetooth.init bluetooth.default create_dev install-data-local: $(INSTALL) -D -m 755 $(srcdir)/bluetooth.init $(DESTDIR)$(sysconfdir)/init.d/bluetooth - $(INSTALL) -D -m 644 $(srcdir)/bluetooth.default $(DESTDIR)$(sysconfdir)/default/bluetooth + $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/default + [ -f $(DESTDIR)$(sysconfdir)/default/bluetooth ] || \ + $(INSTALL_DATA) $(srcdir)/bluetooth.default $(DESTDIR)$(sysconfdir)/default/bluetooth -- cgit From 7b058edb0e54176809bfcce6567c82cb608029ba Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 7 May 2004 22:04:27 +0000 Subject: Allow options for hidd --- scripts/bluetooth.default | 3 +++ scripts/bluetooth.init | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.default b/scripts/bluetooth.default index d96342c6..4817d38c 100644 --- a/scripts/bluetooth.default +++ b/scripts/bluetooth.default @@ -12,6 +12,9 @@ SDPD_ENABLE=true # Start hidd (allowed values are "true" and "false") HIDD_ENABLE=true +# Arguments to hidd +HIDD_OPTIONS="" + # Run hid2hci (allowed values are "true" and "false") HID2HCI_ENABLE=true diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index d0b053cf..85d3a32e 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -36,6 +36,7 @@ PAND_ENABLE=false HCID_CONFIG="/etc/bluetooth/hcid.conf" RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" +HIDD_OPTIONS="" DUND_OPTIONS="" PAND_OPTIONS="" @@ -53,11 +54,11 @@ case "$1" in echo -n " $SDPD_NAME" fi if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then - $HIDD_EXEC --tohci + $HIDD_EXEC $HIDD_OPTIONS echo -n " $HIDD_NAME" fi if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then - $HID2HCI_EXEC + $HID2HCI_EXEC --tohci echo -n " $HID2HCI_NAME" fi if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] ; then -- cgit From e02418e9d5439bf9f74febd1a98a3769fac98c81 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 7 May 2004 22:17:48 +0000 Subject: Add server flag to hidd --- scripts/bluetooth.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index 85d3a32e..4a37698b 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -54,7 +54,7 @@ case "$1" in echo -n " $SDPD_NAME" fi if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then - $HIDD_EXEC $HIDD_OPTIONS + $HIDD_EXEC $HIDD_OPTIONS --server echo -n " $HIDD_NAME" fi if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then -- cgit From 64c432fe558cb3e57152a36af44885311975ce5e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 7 May 2004 22:50:00 +0000 Subject: Better error handling --- scripts/bluetooth.init | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index 4a37698b..11162ee9 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -20,7 +20,7 @@ DUND_NAME=dund HCID_EXEC="`which $HCID_NAME || true`" SDPD_EXEC="`which $SDPD_NAME || true`" HIDD_EXEC="`which $HIDD_NAME || true`" -HID2HCI_EXEC="`which $HIDD_NAME || true`" +HID2HCI_EXEC="`which $HID2HCI_NAME || true`" RFCOMM_EXEC="`which $RFCOMM_NAME || true`" PAND_EXEC="`which $PAND_NAME || true`" DUND_EXEC="`which $DUND_NAME || true`" @@ -54,15 +54,15 @@ case "$1" in echo -n " $SDPD_NAME" fi if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then - $HIDD_EXEC $HIDD_OPTIONS --server + $HIDD_EXEC $HIDD_OPTIONS --server || true echo -n " $HIDD_NAME" fi if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then - $HID2HCI_EXEC --tohci + $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true echo -n " $HID2HCI_NAME" fi if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] ; then - $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all + $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true echo -n " $RFCOMM_NAME" fi if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; then @@ -77,19 +77,19 @@ case "$1" in ;; stop) echo -n "Stopping $DESC:" - killall $PAND_EXEC > /dev/null 2>&1 || true + killall $PAND_NAME > /dev/null 2>&1 || true echo -n " $PAND_NAME" - killall $DUND_EXEC > /dev/null 2>&1 || true + killall $DUND_NAME > /dev/null 2>&1 || true echo -n " $DUND_NAME" if [ -x "$RFCOMM_EXEC" ] ; then $RFCOMM_EXEC release all echo -n " $RFCOMM_NAME" fi - killall $HIDD_EXEC > /dev/null 2>&1 || true + killall $HIDD_NAME > /dev/null 2>&1 || true echo -n " $HIDD_NAME" - killall $SDPD_EXEC > /dev/null 2>&1 || true + killall $SDPD_NAME > /dev/null 2>&1 || true echo -n " $SDPD_NAME" - killall $HCID_EXEC > /dev/null 2>&1 || true + killall $HCID_NAME > /dev/null 2>&1 || true echo -n " $HCID_NAME" echo "." ;; -- cgit From e58717d76bcba3ac0ee6cc5a4e6a03d5d307c0d9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 7 May 2004 22:57:34 +0000 Subject: One more fix --- scripts/bluetooth.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index 11162ee9..82cd68cf 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -82,7 +82,7 @@ case "$1" in killall $DUND_NAME > /dev/null 2>&1 || true echo -n " $DUND_NAME" if [ -x "$RFCOMM_EXEC" ] ; then - $RFCOMM_EXEC release all + $RFCOMM_EXEC release all > /dev/null 2>&1 || true echo -n " $RFCOMM_NAME" fi killall $HIDD_NAME > /dev/null 2>&1 || true -- cgit From 15c1cf1ca0d2fc45dff471d71339db49deecd1cd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 21 Jul 2004 15:20:28 +0000 Subject: Make use of MAINTAINERCLEANFILES --- scripts/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index f375290c..677e1306 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -6,6 +6,8 @@ bin_SCRIPTS = bluepin EXTRA_DIST = bluepin bluetooth.init bluetooth.default create_dev +MAINTAINERCLEANFILES = Makefile.in + install-data-local: $(INSTALL) -D -m 755 $(srcdir)/bluetooth.init $(DESTDIR)$(sysconfdir)/init.d/bluetooth $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/default -- cgit From 44dd3537501540b967bb368c16279242c4bb5f14 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 21 Jul 2004 15:40:55 +0000 Subject: Uninstall local files --- scripts/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 677e1306..741ae080 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -13,3 +13,7 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/default [ -f $(DESTDIR)$(sysconfdir)/default/bluetooth ] || \ $(INSTALL_DATA) $(srcdir)/bluetooth.default $(DESTDIR)$(sysconfdir)/default/bluetooth + +uninstall-local: + @rm -f $(DESTDIR)$(sysconfdir)/init.d/bluetooth + @rm -f $(DESTDIR)$(sysconfdir)/default/bluetooth -- cgit From da2cf82c5b073be1bc3f3185a16722a2f5d289de Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 12 Aug 2004 12:47:37 +0000 Subject: Make the installation of the init scripts and bluepin optional --- scripts/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 741ae080..e77f3f12 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -2,12 +2,15 @@ # $Id$ # +if BLUEPIN bin_SCRIPTS = bluepin +endif EXTRA_DIST = bluepin bluetooth.init bluetooth.default create_dev MAINTAINERCLEANFILES = Makefile.in +if INITSCRIPTS install-data-local: $(INSTALL) -D -m 755 $(srcdir)/bluetooth.init $(DESTDIR)$(sysconfdir)/init.d/bluetooth $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/default @@ -17,3 +20,4 @@ install-data-local: uninstall-local: @rm -f $(DESTDIR)$(sysconfdir)/init.d/bluetooth @rm -f $(DESTDIR)$(sysconfdir)/default/bluetooth +endif -- cgit From 69ae05c1fc41eba63442939e1ea69433271de3da Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2005 03:52:04 +0000 Subject: Most X servers are now Xorg --- scripts/bluepin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bluepin b/scripts/bluepin index 607facba..741765b7 100755 --- a/scripts/bluepin +++ b/scripts/bluepin @@ -15,7 +15,7 @@ pygtk.require('2.0') def set_display(): disp = ":0" auth = "" - proc = "-C X -C XFree86" + proc = "-C X -C Xorg -C XFree86" ps = "/bin/ps " + proc + " --format args --no-headers" r,w = popen2.popen2(ps) -- cgit From 632a9432774ff3a0c6e556e8f32a565b38890767 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Oct 2005 22:36:31 +0000 Subject: Big cleanup of CVS relics --- scripts/Makefile.am | 3 --- scripts/create_dev | 2 -- 2 files changed, 5 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e77f3f12..94508c66 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,6 +1,3 @@ -# -# $Id$ -# if BLUEPIN bin_SCRIPTS = bluepin diff --git a/scripts/create_dev b/scripts/create_dev index 4ea0c263..f3054793 100755 --- a/scripts/create_dev +++ b/scripts/create_dev @@ -2,8 +2,6 @@ # # Create Bluetooth devices in /dev # -# $Id$ -# VHCI_MAJOR=10 VHCI_MINOR=250 -- cgit From 020ac98f0656d3f95d1bb38ea546f145897446fa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 12 Mar 2006 18:09:43 +0000 Subject: Remove bluepin script --- scripts/Makefile.am | 6 +- scripts/bluepin | 164 ---------------------------------------------------- 2 files changed, 1 insertion(+), 169 deletions(-) delete mode 100755 scripts/bluepin (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 94508c66..edaa129e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,9 +1,5 @@ -if BLUEPIN -bin_SCRIPTS = bluepin -endif - -EXTRA_DIST = bluepin bluetooth.init bluetooth.default create_dev +EXTRA_DIST = bluetooth.init bluetooth.default create_dev MAINTAINERCLEANFILES = Makefile.in diff --git a/scripts/bluepin b/scripts/bluepin deleted file mode 100755 index 741765b7..00000000 --- a/scripts/bluepin +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/python -# -# Bluetooth PIN helper -# Written by Maxim Krasnyansky -# -import sys, os, string, popen2, pygtk - -pygtk.require('2.0') - -# X Display initialization. -# Find running X Server and parse its arguments. -# Set environment variables DISPLAY and XAUTHORITY -# using info extracted from X Server args. -# -def set_display(): - disp = ":0" - auth = "" - proc = "-C X -C Xorg -C XFree86" - ps = "/bin/ps " + proc + " --format args --no-headers" - - r,w = popen2.popen2(ps) - arg = string.split(r.read()) - for i in range(1, len(arg)): - if arg[i][0] != '-' and i==1: - disp = arg[i] - elif arg[i] == "-auth": - auth = arg[i+1] - break - - os.environ['DISPLAY'] = disp - os.environ['XAUTHORITY'] = auth - -# Set X display before initializing GTK -set_display() - -# Some versions of fontconfig will segfault if HOME isn't set. -os.environ['HOME'] = "" - -import gtk - -# Dialog Class -DLG_OK = 1 -DLG_CANCEL = 2 -class Dialog(gtk.Dialog): - result = DLG_CANCEL - args = {} - def __init__(self, modal=gtk.FALSE, mesg=None, args = {}): - gtk.Dialog.__init__(self) - self.args = args - self.set_modal(modal) -# self.set_usize(400, 0) -# self.set_uposition(300,300) - - self.connect("destroy", self.quit) - self.connect("delete_event", self.quit) - - self.action_area.set_border_width(2) - - ok = gtk.Button("Accept") - ok.connect("clicked", self.ok) - self.action_area.pack_start(ok, padding = 20) - ok.show() - - cl = gtk.Button("Reject") - cl.connect("clicked", self.cancel) - self.action_area.pack_start(cl, padding = 20) - cl.show() - - if mesg: - msg = gtk.Label("") - msg.set_text(mesg) - self.vbox.pack_start(msg, padding = 10) - msg.show() - - self.ents = [] - for k in self.args.keys(): - hbox = gtk.HBox() - hbox.set_border_width(5) - self.vbox.pack_start(hbox) - hbox.show() - - l = gtk.Label("") - e = gtk.Entry() - l.set_text( k ) - e.set_text( self.args[k] ) - e.connect("key_press_event", self.key_press) - hbox.pack_start(l, padding = 10, expand = gtk.FALSE) - hbox.pack_start(e) - l.show() - e.show() - - self.ents.append( (k, e) ) - - self.ents[0][1].grab_focus() - - def key_press(self, entry, event): - if event.keyval == gtk.keysyms.Return: - entry.emit_stop_by_name("key_press_event") - self.ok() - elif event.keyval == gtk.keysyms.Escape: - entry.emit_stop_by_name("key_press_event") - self.cancel() - - def ok(self, *args): - self.result = DLG_OK - for e in self.ents: - k = e[0] - self.args[k] = e[1].get_text() - self.quit() - - def cancel(self, *args): - self.result = DLG_CANCEL - self.quit() - - def quit(self, *args): - self.hide() - self.destroy() - gtk.mainquit() - -def dialog(title, mesg, args, modal = gtk.FALSE): - dlg = Dialog(args = args, mesg = mesg, modal = modal) - dlg.set_title(title) - dlg.show() - gtk.mainloop() - return dlg.result - -def main(*args): - if len(sys.argv) < 2: - print "ERR" - sys.exit() - - dir = sys.argv[1] - bdaddr = sys.argv[2] - - if len(sys.argv) > 3: - name = sys.argv[3] - else: - name = "" - - title = "Bluetooth PIN Code" - - # Bluetooth spec recommends automatic strong random PIN generation. - # So eventually we should implement that. - pin = { "PIN": "" } - - if dir == "out": - mesg = "Outgoing connection to " - else: - mesg = "Incoming connection from " - - mesg = mesg + name + "[" + bdaddr + "]" - - if dialog(title, mesg, pin) == DLG_OK: - pin["PIN"] = string.strip(pin["PIN"]) - - if len(pin["PIN"]) >= 1 and len(pin["PIN"]) <= 16: - print "PIN:" + pin["PIN"] - else: - print "ERR" - else: - print "ERR" - -# -main() -- cgit From 48911619f75e2809b145c0bd5cd60cb80b1c1b69 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 6 Jun 2006 00:10:35 +0000 Subject: Remove create_dev script --- scripts/Makefile.am | 2 +- scripts/create_dev | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100755 scripts/create_dev (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index edaa129e..085d0a10 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,5 +1,5 @@ -EXTRA_DIST = bluetooth.init bluetooth.default create_dev +EXTRA_DIST = bluetooth.init bluetooth.default MAINTAINERCLEANFILES = Makefile.in diff --git a/scripts/create_dev b/scripts/create_dev deleted file mode 100755 index f3054793..00000000 --- a/scripts/create_dev +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# Create Bluetooth devices in /dev -# - -VHCI_MAJOR=10 -VHCI_MINOR=250 - -RFCOMM_MAJOR=216 - -# -# Create device for VHCI -# -if [ ! -c /dev/vhci ]; then - mknod /dev/vhci c ${VHCI_MAJOR} ${VHCI_MINOR} - chmod 664 /dev/vhci -fi - -# -# Create devices for RFCOMM -# -for i in `seq 0 255` -do - if [ ! -c /dev/rfcomm$i ]; then - mknod -m 666 /dev/rfcomm$i c ${RFCOMM_MAJOR} $i - fi -done -- cgit From 876bfd3a0da64aaa188717aefed829fc2ec6c91b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Aug 2006 10:09:05 +0000 Subject: Add udev rules for Bluetooth serial PCMCIA cards --- scripts/Makefile.am | 6 +++++- scripts/bluetooth.rules | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 scripts/bluetooth.rules (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 085d0a10..c6ab7301 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,5 +1,9 @@ -EXTRA_DIST = bluetooth.init bluetooth.default +rulesdir = $(sysconfdir)/udev + +rules_DATA = bluetooth.rules + +EXTRA_DIST = $(rules_DATA) bluetooth.init bluetooth.default MAINTAINERCLEANFILES = Makefile.in diff --git a/scripts/bluetooth.rules b/scripts/bluetooth.rules new file mode 100644 index 00000000..2622a875 --- /dev/null +++ b/scripts/bluetooth.rules @@ -0,0 +1,36 @@ +# Serial PCMCIA Cards +SUBSYSTEM=="tty", BUS=="pcmcia", ENV{MANF_ID}="$sysfs{manf_id}", ENV{CARD_ID}="$sysfs{card_id}" + + +# Brain Boxes BL-620 Bluetooth Adapter +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", RUN+="bluetooth_serial" + +# Xircom CreditCard Bluetooth Adapter +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", RUN+="bluetooth_serial" + +# Xircom RealPort2 Bluetooth Adapter +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", RUN+="bluetooth_serial" + +# IBM Bluetooth PC Card II +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="IBM", SYSFS{prod_id2}=="Bluetooth PC Card II", RUN+="bluetooth_serial" + +# TDK Bluetooth PC Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="TDK", SYSFS{prod_id2}=="Bluetooth PC Card II", RUN+="bluetooth_serial" + +# AmbiCom BT2000C Bluetooth PC/CF Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="AmbiCom BT2000C", SYSFS{prod_id2}=="Bluetooth PC/CF Card", RUN+="bluetooth_serial" + +# COM One Platinium Bluetooth PC Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="COM1 SA", SYSFS{prod_id2}=="MC310 CARD", RUN+="bluetooth_serial" + +# Sphinx PICO Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="SPHINX", SYSFS{prod_id2}=="BT-CARD", RUN+="bluetooth_serial" + +# H-Soft blue+Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="H-Soft", SYSFS{prod_id2}=="Blue+CARD", RUN+="bluetooth_serial" + +# Compaq iPAQ Bluetooth Sleeve +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="CF CARD", SYSFS{prod_id2}=="GENERIC", RUN+="bluetooth_serial" + +# Zoom Bluetooth Card and Sitecom CN-504 Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="PCMCIA", SYSFS{prod_id2}=="Bluetooth Card", RUN+="bluetooth_serial" -- cgit From 58e445d114b13530c7e1372b1920fffed7b8387f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Aug 2006 10:30:06 +0000 Subject: Add udev script for Bluetooth serial PCMCIA cards --- scripts/Makefile.am | 6 +++++- scripts/bluetooth_serial | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 scripts/bluetooth_serial (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index c6ab7301..33782368 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -3,7 +3,11 @@ rulesdir = $(sysconfdir)/udev rules_DATA = bluetooth.rules -EXTRA_DIST = $(rules_DATA) bluetooth.init bluetooth.default +udevdir = /lib/udev + +udev_SCRIPTS = bluetooth_serial + +EXTRA_DIST = $(rules_DATA) $(udev_SCRIPTS) bluetooth.init bluetooth.default MAINTAINERCLEANFILES = Makefile.in diff --git a/scripts/bluetooth_serial b/scripts/bluetooth_serial new file mode 100644 index 00000000..6461e78d --- /dev/null +++ b/scripts/bluetooth_serial @@ -0,0 +1,44 @@ +#!/bin/sh +# +# bluetooth_serial +# +# Bluetooth serial PCMCIA card initialization +# + +start_serial() +{ + if [ ! -x /bin/setserial -o ! -x /usr/sbin/hciattach ]; then + logger "$0: setserial or hciattach not executable, cannot start $DEVNAME" + return 1 + fi + + IRQ=`/bin/setserial $DEVNAME | sed -e 's/.*IRQ: //'` + /bin/setserial $DEVNAME irq 0 ; /bin/setserial $DEVNAME irq $IRQ + + MANF_CARD_ID="${MANF_ID},${CARD_ID}" + # I don't have a generic solution, sorry + if [ $MANF_CARD_ID = "0x0160,0x0002" ]; then + /usr/sbin/hciattach $DEVNAME $MANF_CARD_ID 115200 + else + /usr/sbin/hciattach $DEVNAME $MANF_CARD_ID + fi +} + +stop_serial() +{ + [ -x /bin/fuser ] || return 1 + + /bin/fuser -k -HUP $DEVNAME > /dev/null +} + +case "$ACTION" in + add) + start_serial + ;; + remove) + stop_serial + ;; + *) + logger "Unknown action received $0: $ACTION" + ;; +esac -- cgit From 022821c566ee6910fd239843ffbdc3b5e8fcdd11 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Aug 2006 10:45:48 +0000 Subject: Provide an ${udevexecdir} --- scripts/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 33782368..b9395a6d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -3,7 +3,7 @@ rulesdir = $(sysconfdir)/udev rules_DATA = bluetooth.rules -udevdir = /lib/udev +udevdir = $(udevexecdir) udev_SCRIPTS = bluetooth_serial -- cgit From 7163f8e5b08752f27d63bd968c8653f8c743f668 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Aug 2006 11:08:49 +0000 Subject: Use ${libexecdir} for the udev script directory --- scripts/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b9395a6d..55da7180 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -3,7 +3,7 @@ rulesdir = $(sysconfdir)/udev rules_DATA = bluetooth.rules -udevdir = $(udevexecdir) +udevdir = $(libexecdir)/udev udev_SCRIPTS = bluetooth_serial -- cgit From 80e725ed106e3281a12682325ee700305189295c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 20 Aug 2006 02:02:20 +0000 Subject: Make installation of udev rules optional --- scripts/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 55da7180..6a8eec7f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,4 +1,5 @@ +if PCMCIARULES rulesdir = $(sysconfdir)/udev rules_DATA = bluetooth.rules @@ -6,8 +7,9 @@ rules_DATA = bluetooth.rules udevdir = $(libexecdir)/udev udev_SCRIPTS = bluetooth_serial +endif -EXTRA_DIST = $(rules_DATA) $(udev_SCRIPTS) bluetooth.init bluetooth.default +EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default MAINTAINERCLEANFILES = Makefile.in -- cgit From 117091aff7a9416b9fe58214b8a9118cd88a9fb3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 10:54:36 +0000 Subject: More compatible usage of test --- scripts/bluetooth.init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index 82cd68cf..fad223fd 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -45,7 +45,7 @@ PAND_OPTIONS="" case "$1" in start) echo -n "Starting $DESC:" - if $HCID_ENABLE && [ -x "$HCID_EXEC" -a -f "$HCID_CONFIG" ] ; then + if $HCID_ENABLE && [ -x "$HCID_EXEC" ] && [ -f "$HCID_CONFIG" ] ; then $HCID_EXEC -f $HCID_CONFIG echo -n " $HCID_NAME" fi @@ -61,15 +61,15 @@ case "$1" in $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true echo -n " $HID2HCI_NAME" fi - if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] ; then + if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" ] && [ -f "$RFCOMM_CONFIG" ] ; then $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true echo -n " $RFCOMM_NAME" fi - if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; then + if $DUND_ENABLE && [ -x "$DUND_EXEC" ] && [ -n "$DUND_OPTIONS" ] ; then $DUND_EXEC $DUND_OPTIONS echo -n " $DUND_NAME" fi - if $PAND_ENABLE && [ -x "$PAND_EXEC" -a -n "$PAND_OPTIONS" ] ; then + if $PAND_ENABLE && [ -x "$PAND_EXEC" ] && [ -n "$PAND_OPTIONS" ] ; then $PAND_EXEC $PAND_OPTIONS echo -n " $PAND_NAME" fi -- cgit From cab0f75d370f670d3076928333b97bf1e86bd269 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 1 Oct 2006 16:11:34 +0000 Subject: Update serial PCMCIA bases card support --- scripts/bluetooth.rules | 31 +++++++++++++++---------------- scripts/bluetooth_serial | 13 ++++--------- 2 files changed, 19 insertions(+), 25 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.rules b/scripts/bluetooth.rules index 2622a875..0957225f 100644 --- a/scripts/bluetooth.rules +++ b/scripts/bluetooth.rules @@ -1,36 +1,35 @@ -# Serial PCMCIA Cards -SUBSYSTEM=="tty", BUS=="pcmcia", ENV{MANF_ID}="$sysfs{manf_id}", ENV{CARD_ID}="$sysfs{card_id}" - - # Brain Boxes BL-620 Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", ENV{HCIOPTS}="bboxes", RUN+="bluetooth_serial" # Xircom CreditCard Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" # Xircom RealPort2 Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" # IBM Bluetooth PC Card II -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="IBM", SYSFS{prod_id2}=="Bluetooth PC Card II", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="IBM", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" # TDK Bluetooth PC Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="TDK", SYSFS{prod_id2}=="Bluetooth PC Card II", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="TDK", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" # AmbiCom BT2000C Bluetooth PC/CF Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="AmbiCom BT2000C", SYSFS{prod_id2}=="Bluetooth PC/CF Card", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="AmbiCom BT2000C", SYSFS{prod_id2}=="Bluetooth PC/CF Card", ENV{HCIOPTS}="bt2000c", RUN+="bluetooth_serial" # COM One Platinium Bluetooth PC Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="COM1 SA", SYSFS{prod_id2}=="MC310 CARD", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="COM1 SA", SYSFS{prod_id2}=="MC310 CARD", ENV{HCIOPTS}="comone", RUN+="bluetooth_serial" # Sphinx PICO Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="SPHINX", SYSFS{prod_id2}=="BT-CARD", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="SPHINX", SYSFS{prod_id2}=="BT-CARD", ENV{HCIOPTS}="picocard", RUN+="bluetooth_serial" # H-Soft blue+Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="H-Soft", SYSFS{prod_id2}=="Blue+CARD", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="H-Soft", SYSFS{prod_id2}=="Blue+CARD", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" -# Compaq iPAQ Bluetooth Sleeve -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="CF CARD", SYSFS{prod_id2}=="GENERIC", RUN+="bluetooth_serial" +# Compaq iPAQ Bluetooth Sleeve, Belkin F8T020, any other muppet who used an OXCF950 and didn't bother to program it appropriately. +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="CF CARD", SYSFS{prod_id2}=="GENERIC", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" # Zoom Bluetooth Card and Sitecom CN-504 Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="PCMCIA", SYSFS{prod_id2}=="Bluetooth Card", RUN+="bluetooth_serial" +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="PCMCIA", SYSFS{prod_id2}=="Bluetooth Card", ENV{HCIOPTS}="zoom", RUN+="bluetooth_serial" + +# CC&C BT0100M +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Bluetooth BT0100M", ENV{HCIOPTS}="bcsp 115200", RUN+="bluetooth_serial" diff --git a/scripts/bluetooth_serial b/scripts/bluetooth_serial index 6461e78d..e5be6c2e 100644 --- a/scripts/bluetooth_serial +++ b/scripts/bluetooth_serial @@ -12,16 +12,11 @@ start_serial() return 1 fi - IRQ=`/bin/setserial $DEVNAME | sed -e 's/.*IRQ: //'` - /bin/setserial $DEVNAME irq 0 ; /bin/setserial $DEVNAME irq $IRQ - - MANF_CARD_ID="${MANF_ID},${CARD_ID}" - # I don't have a generic solution, sorry - if [ $MANF_CARD_ID = "0x0160,0x0002" ]; then - /usr/sbin/hciattach $DEVNAME $MANF_CARD_ID 115200 - else - /usr/sbin/hciattach $DEVNAME $MANF_CARD_ID + if [ "$BAUDBASE" != "" ]; then + /bin/setserial $DEVNAME baud_base $BAUDBASE fi + + /usr/sbin/hciattach $DEVNAME $HCIOPTS 2>&1 | logger -t hciattach } stop_serial() -- cgit From e13a5a7590fe4cd454bd524463243a99d94cc9ef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 14 Jan 2007 00:49:29 +0000 Subject: Use SDP server included in hcid --- scripts/bluetooth.default | 4 ++-- scripts/bluetooth.init | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.default b/scripts/bluetooth.default index 4817d38c..976fa245 100644 --- a/scripts/bluetooth.default +++ b/scripts/bluetooth.default @@ -7,7 +7,7 @@ HCID_ENABLE=true HCID_CONFIG="/etc/bluetooth/hcid.conf" # Start sdpd (allowed values are "true" and "false") -SDPD_ENABLE=true +SDPD_ENABLE=false # Start hidd (allowed values are "true" and "false") HIDD_ENABLE=true @@ -19,7 +19,7 @@ HIDD_OPTIONS="" HID2HCI_ENABLE=true # Bind rfcomm devices (allowed values are "true" and "false") -RFCOMM_ENABLE=true +RFCOMM_ENABLE=false # Config file for rfcomm RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index fad223fd..f1bf358f 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -26,10 +26,10 @@ PAND_EXEC="`which $PAND_NAME || true`" DUND_EXEC="`which $DUND_NAME || true`" HCID_ENABLE=true -SDPD_ENABLE=true +SDPD_ENABLE=false HIDD_ENABLE=false HID2HCI_ENABLE=false -RFCOMM_ENABLE=true +RFCOMM_ENABLE=false DUND_ENABLE=false PAND_ENABLE=false @@ -46,7 +46,11 @@ case "$1" in start) echo -n "Starting $DESC:" if $HCID_ENABLE && [ -x "$HCID_EXEC" ] && [ -f "$HCID_CONFIG" ] ; then - $HCID_EXEC -f $HCID_CONFIG + if $SDPD_ENABLE ; then + $HCID_EXEC -f $HCID_CONFIG + else + $HCID_EXEC -s -f $HCID_CONFIG + fi echo -n " $HCID_NAME" fi if $SDPD_ENABLE && [ -x "$SDPD_EXEC" ] ; then -- cgit From a16c5df68407649eb2c190ab71ab0a0be25209e6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 14 May 2007 08:17:59 +0000 Subject: Use a simple init script --- scripts/bluetooth.default | 33 --------------------- scripts/bluetooth.init | 74 ++++++----------------------------------------- 2 files changed, 9 insertions(+), 98 deletions(-) (limited to 'scripts') diff --git a/scripts/bluetooth.default b/scripts/bluetooth.default index 976fa245..b0c4493b 100644 --- a/scripts/bluetooth.default +++ b/scripts/bluetooth.default @@ -1,37 +1,4 @@ # Bluetooth configuraton file -# Start of hcid (allowed values are "true" and "false") -HCID_ENABLE=true - -# Config file for hcid -HCID_CONFIG="/etc/bluetooth/hcid.conf" - -# Start sdpd (allowed values are "true" and "false") -SDPD_ENABLE=false - -# Start hidd (allowed values are "true" and "false") -HIDD_ENABLE=true - -# Arguments to hidd -HIDD_OPTIONS="" - # Run hid2hci (allowed values are "true" and "false") HID2HCI_ENABLE=true - -# Bind rfcomm devices (allowed values are "true" and "false") -RFCOMM_ENABLE=false - -# Config file for rfcomm -RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" - -# Start dund (allowed values are "true" and "false") -DUND_ENABLE=false - -# Arguments to dund -DUND_OPTIONS="--listen --persist" - -# Start pand (allowed values are "true" and "false") -PAND_ENABLE=false - -# Arguments to pand -PAND_OPTIONS="--listen --role NAP" diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init index f1bf358f..83260035 100644 --- a/scripts/bluetooth.init +++ b/scripts/bluetooth.init @@ -9,92 +9,36 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=bluetooth DESC="Bluetooth subsystem" -HCID_NAME=hcid -SDPD_NAME=sdpd -HIDD_NAME=hidd +DAEMON_NAME=hcid HID2HCI_NAME=hid2hci -RFCOMM_NAME=rfcomm -PAND_NAME=pand -DUND_NAME=dund -HCID_EXEC="`which $HCID_NAME || true`" -SDPD_EXEC="`which $SDPD_NAME || true`" -HIDD_EXEC="`which $HIDD_NAME || true`" +DAEMON_EXEC="`which $DAEMON_NAME || true`" HID2HCI_EXEC="`which $HID2HCI_NAME || true`" -RFCOMM_EXEC="`which $RFCOMM_NAME || true`" -PAND_EXEC="`which $PAND_NAME || true`" -DUND_EXEC="`which $DUND_NAME || true`" -HCID_ENABLE=true -SDPD_ENABLE=false -HIDD_ENABLE=false +DAEMON_ENABLE=true HID2HCI_ENABLE=false -RFCOMM_ENABLE=false -DUND_ENABLE=false -PAND_ENABLE=false -HCID_CONFIG="/etc/bluetooth/hcid.conf" -RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" - -HIDD_OPTIONS="" -DUND_OPTIONS="" -PAND_OPTIONS="" +DAEMON_CONFIG="/etc/bluetooth/hcid.conf" [ -e /etc/default/bluetooth ] && . /etc/default/bluetooth case "$1" in start) echo -n "Starting $DESC:" - if $HCID_ENABLE && [ -x "$HCID_EXEC" ] && [ -f "$HCID_CONFIG" ] ; then - if $SDPD_ENABLE ; then - $HCID_EXEC -f $HCID_CONFIG - else - $HCID_EXEC -s -f $HCID_CONFIG - fi - echo -n " $HCID_NAME" - fi - if $SDPD_ENABLE && [ -x "$SDPD_EXEC" ] ; then - $SDPD_EXEC - echo -n " $SDPD_NAME" - fi - if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then - $HIDD_EXEC $HIDD_OPTIONS --server || true - echo -n " $HIDD_NAME" + if $DAEMON_ENABLE && [ -x "$DAEMON_EXEC" ] && [ -f "$DAEMON_CONFIG" ] ; then + $DAEMON_EXEC -s -f $DAEMON_CONFIG + echo -n " $DAEMON_NAME" fi if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true echo -n " $HID2HCI_NAME" fi - if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" ] && [ -f "$RFCOMM_CONFIG" ] ; then - $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true - echo -n " $RFCOMM_NAME" - fi - if $DUND_ENABLE && [ -x "$DUND_EXEC" ] && [ -n "$DUND_OPTIONS" ] ; then - $DUND_EXEC $DUND_OPTIONS - echo -n " $DUND_NAME" - fi - if $PAND_ENABLE && [ -x "$PAND_EXEC" ] && [ -n "$PAND_OPTIONS" ] ; then - $PAND_EXEC $PAND_OPTIONS - echo -n " $PAND_NAME" - fi echo "." ;; stop) echo -n "Stopping $DESC:" - killall $PAND_NAME > /dev/null 2>&1 || true - echo -n " $PAND_NAME" - killall $DUND_NAME > /dev/null 2>&1 || true - echo -n " $DUND_NAME" - if [ -x "$RFCOMM_EXEC" ] ; then - $RFCOMM_EXEC release all > /dev/null 2>&1 || true - echo -n " $RFCOMM_NAME" - fi - killall $HIDD_NAME > /dev/null 2>&1 || true - echo -n " $HIDD_NAME" - killall $SDPD_NAME > /dev/null 2>&1 || true - echo -n " $SDPD_NAME" - killall $HCID_NAME > /dev/null 2>&1 || true - echo -n " $HCID_NAME" + killall $DAEMON_NAME > /dev/null 2>&1 || true + echo -n " $DAEMON_NAME" echo "." ;; *) -- cgit