SOURCES (AC-branch): bluez-utils-udev.rules (NEW), bluez-utils-ude...

baggins baggins at pld-linux.org
Wed May 17 17:38:40 CEST 2006


Author: baggins                      Date: Wed May 17 15:38:40 2006 GMT
Module: SOURCES                       Tag: AC-branch
---- Log message:
- from HEAD

---- Files affected:
SOURCES:
   bluez-utils-udev.rules (NONE -> 1.1.2.1)  (NEW), bluez-utils-udev.script (NONE -> 1.1.2.1)  (NEW), bluez-utils.init (1.8 -> 1.8.2.1) , bluez-utils.sysconfig (1.1 -> 1.1.2.1) 

---- Diffs:

================================================================
Index: SOURCES/bluez-utils-udev.rules
diff -u /dev/null SOURCES/bluez-utils-udev.rules:1.1.2.1
--- /dev/null	Wed May 17 17:38:40 2006
+++ SOURCES/bluez-utils-udev.rules	Wed May 17 17:38:35 2006
@@ -0,0 +1,3 @@
+# Bluetooth devices:
+#
+KERNEL=="hci[0-9]*", RUN+="/lib/udev/bluetooth.sh"

================================================================
Index: SOURCES/bluez-utils-udev.script
diff -u /dev/null SOURCES/bluez-utils-udev.script:1.1.2.1
--- /dev/null	Wed May 17 17:38:40 2006
+++ SOURCES/bluez-utils-udev.script	Wed May 17 17:38:35 2006
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# bluetooth.sh: udev external RUN script
+#
+# Copyright 2005-2006 Henrik Brix Andersen <brix at gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+script=/etc/rc.d/init.d/bluetooth
+
+# Find out where sysfs is mounted. Exit if not available
+sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
+if [ "$sysfs" = "" ]; then
+    echo "sysfs is required"
+    exit 1
+fi
+
+if [ ! -d $sysfs/class/bluetooth/hci[0-9]* ]; then
+    if $script --quiet status; then
+	$script stop
+    fi
+else
+    if ! $script --quiet status; then
+	$script start
+    fi
+fi

================================================================
Index: SOURCES/bluez-utils.init
diff -u SOURCES/bluez-utils.init:1.8 SOURCES/bluez-utils.init:1.8.2.1
--- SOURCES/bluez-utils.init:1.8	Thu Dec  8 02:02:49 2005
+++ SOURCES/bluez-utils.init	Wed May 17 17:38:35 2006
@@ -25,46 +25,98 @@
   start)
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/bluetooth ]; then
-		msg_starting Bluetooth
+		msg_starting bluetooth; started
+		if is_yes "${HID2HCI_ENABLE}" && [ -x /usr/sbin/hid2hci ]; then
+			msg_starting hid2hci
+			daemon /usr/sbin/hid2hci -0 -q    #be quiet
+			RETVAL=$?
+			/bin/sleep 1 # delay for hid's to be detected by hotplug
+		fi
+		
+		if is_yes "${HCID_ENABLE}" && [ -x /usr/sbin/hcid ]; then
+			msg_starting hcid
+			daemon /usr/sbin/hcid -f /etc/bluetooth/hcid.conf
+			RETVAL=$?
+		fi
+	
+		if is_yes "${SDPD_ENABLE}" && [ -x /usr/sbin/sdpd ]; then
+			msg_starting sdpd
+			daemon /usr/sbin/sdpd
+			RETVAL=$?
+		fi
+		
+		if is_yes "${HIDD_ENABLE}" && [ -x /usr/bin/hidd ]; then
+			msg_starting hidd
+			daemon /usr/bin/hidd ${HIDD_OPTIONS} --server
+			RETVAL=$?
+		fi
+
+		if is_yes "${RFCOMM_ENABLE}" && [ -x /usr/bin/rfcomm ]; then
+			msg_starting rfcomm
+			daemon /usr/bin/rfcomm -f /etc/bluetooth/rfcomm.conf bind all
+			RETVAL=$?
+		fi
+	
+		if is_yes "${DUND_ENABLE}" && [ -x /usr/bin/dund ]; then
+			msg_starting dund
+			daemon /usr/bin/dund ${DUND_OPTIONS}
+			RETVAL=$?
+		fi
+	
+		if is_yes "${PAND_ENABLE}" && [ -x /usr/bin/pand ]; then
+			msg_starting pand
+			daemon /usr/bin/pand ${PAND_OPTIONS}
+			RETVAL=$?
+		fi
+
 		if [ -f /usr/sbin/hciattach -a "$UART_CONF" != "no" ]; then
 			grep -v '^#' $UART_CONF | while read i; do
 				/usr/sbin/hciattach $i
 			done
 		fi
-		daemon /usr/sbin/hcid -f /etc/bluetooth/hcid.conf
-		RETVAL=$?
-		if [ $RETVAL -ne 0 ]; then
-			killproc hciattach >/dev/null 2>&1
-		elif [ -x /usr/sbin/sdpd ]; then
-			msg_starting "Bluetooth SDP"
-			daemon /usr/sbin/sdpd
-			RETVAL=$?
-			if [ $RETVAL -ne 0 ]; then
-				killproc hcid >/dev/null 2>&1
-				if [ "$UART_CONF" != "no" ]; then
-					killproc hciattach >/dev/null 2>&1
-				fi
-			fi
-		fi
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bluetooth
 	else
-		msg_already_running Bluetooth
+		msg_already_running bluetooth
 	fi
 	;;
   stop)
 	if [ -f /var/lock/subsys/bluetooth ]; then
-		if [ -x /usr/sbin/sdpd ]; then
-			msg_stopping "Bluetooth SDP"
-			killproc sdpd
+		if is_yes "${PAND_ENABLE}" && [ -x /usr/bin/pand ]; then
+			msg_stopping pand
+			killproc /usr/bin/pand
+		fi
+
+		if is_yes "${DUND_ENABLE}" && [ -x /usr/bin/dund ]; then
+			msg_stopping dund
+			killproc /usr/bin/dund
+		fi
+
+		if is_yes "${RFCOMM_ENABLE}" && [ -x /usr/bin/rfcomm ]; then
+			msg_stopping rfcomm
+			daemon /usr/bin/rfcomm release all
+		fi
+
+		if is_yes "${HIDD_ENABLE}" && [ -x  /usr/bin/hidd ]; then
+			msg_stopping hidd
+			killproc /usr/bin/hidd
+		fi
+	
+		if is_yes "${SDPD_ENABLE}" && [ -x /usr/sbin/sdpd ]; then
+			msg_stopping sdpd
+			killproc /usr/sbin/sdpd
+		fi
+	
+		if is_yes "${HCID_ENABLE}" && [ -x /usr/sbin/hcid ]; then
+			msg_stopping hcid
+			daemon /usr/sbin/hcid
 		fi
-		msg_stopping Bluetooth
-		killproc hcid
+
 		if [ "$UART_CONF" != "no" ]; then
 			killproc hciattach >/dev/null 2>&1
 		fi
 		rm -f /var/lock/subsys/bluetooth
 	else
-		msg_not_running Bluetooth
+		msg_not_running bluetooth
 	fi
 	;;
   restart)
@@ -74,16 +126,20 @@
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/bluetooth ]; then
-		msg_reloading Bluetooth
+		msg_reloading hcid
 		killproc hcid -HUP
 		RETVAL=$?
 	else
-		msg_not_running Bluetooth >&2
+		msg_not_running bluetooth >&2
 		exit 7
 	fi
 	;;
   status)
-	status hcid
+	is_yes "${HID2HCI_ENABLE}" && status hid2hci
+	is_yes "${HCID_ENABLE}" && status hcid
+	is_yes "${SDPD_ENABLE}" && status sdpd
+	is_yes "${HIDD_ENABLE}" && status hidd
+	is_yes "${DUND_ENABLE}" && status dund
 	exit $?
 	;;
   *)

================================================================
Index: SOURCES/bluez-utils.sysconfig
diff -u SOURCES/bluez-utils.sysconfig:1.1 SOURCES/bluez-utils.sysconfig:1.1.2.1
--- SOURCES/bluez-utils.sysconfig:1.1	Wed Apr 16 17:02:14 2003
+++ SOURCES/bluez-utils.sysconfig	Wed May 17 17:38:35 2006
@@ -6,3 +6,14 @@
 # remove if you have serial Bluetooth dongles configured in /etc/bluetooth/uart
 # (alternatively you can pass uart configuration file path here)
 UART_CONF="no"
+
+#HID2HCI_ENABLE=yes
+HCID_ENABLE=yes
+SDPD_ENABLE=yes
+HIDD_ENABLE=yes
+#HIDD_OPTIONS=""
+RFCOMM_ENABLE=yes
+#DUND_ENABLE=yes
+#DUND_OPTIONS=""
+#PAND_ENABLE=yes
+#PAND_OPTIONS=""
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/bluez-utils.init?r1=1.8&r2=1.8.2.1&f=u
    http://cvs.pld-linux.org/SOURCES/bluez-utils.sysconfig?r1=1.1&r2=1.1.2.1&f=u



More information about the pld-cvs-commit mailing list