[Pkg-bluetooth-maintainers] Bug#359003: udev script missing (?)

Rainer Dorsch rdorsch at web.de
Sat Oct 7 22:27:12 UTC 2006


Hello,

I just upgraded a sarge system to etch and since hotplug is gone in etch, 
attaching my bluetooth usb dongle 

topsi:~# lsusb -v -s 001:006

Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle 
(HCI mode)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x0a12 Cambridge Silicon Radio, Ltd
  idProduct          0x0001 Bluetooth Dongle (HCI mode)
  bcdDevice            5.25
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1


did not start pand as it was with my hotplug script:
topsi:~# cat /etc/hotplug.d/usb/epox-bluetooth.hotplug
#!/bin/sh

# Hotplug script for the Epox BT-DG02A bluetooth dongle for Debian Linux 3.1
#
# The dongle reports several attachments. Therefore we filter for the VERSION.
# pand is started with /etc/init.d/bluez-utils, we restart bluez-utils when a
# dongle is plugged in. On a coldplug (usb dongle is in the system on boot),
# this hotplug script fails (called by rcS.d/S40hotplug), but the regular
# bluez-utils start script rc2.d/S25bluez-utils starts pand in this case

# The direct start-stop-daemon calls are legacy code and should be
# removed if this setup is solid.

pidfile=/var/run/pand.pid
DAEMON=/usr/bin/pand

CHARS=`echo $DEVPATH| wc -c`
VERSION=`echo $DEVPATH|cut -c $((CHARS-3))-$CHARS`

(date
echo $DEVPATH
echo $PRODUCT
echo $TYPE
echo $ACTION
echo $CHARS
echo $VERSION) >> /tmp/epox.log


case `echo $PRODUCT|cut -d / -f 1-2` in
        # a12/1/525 and a12/1/828 have been seen for the Epox BT DB02A
        a12/1) break ;;
        *) exit ;;
esac
case $TYPE in
        224/1/1) break ;;
        *) exit ;;
esac
case $ACTION in
        add)
            if [ ! -z VERSION ]; then
              if [ $VERSION = 1.0 ]; then
                # restart bluez-utils because it might not started up 
correctly
                sleep 2 # required for some reason
                echo Restart bluez-utils >> /tmp/epox.log
                /etc/init.d/bluez-utils restart >> /tmp/epox.log 
2>/tmp/epox.err
#                start-stop-daemon --start --exec $DAEMON -- --nodetach --role 
PANU --search --encrypt --pidfile $pidfile >> /tmp/pand.log
              fi
            fi
            ;;
        remove)
            ifdown bnep0
#            start-stop-daemon --stop --exec $DAEMON --pidfile $pidfile
            /etc/init.d/bluez-utils stop
            ;;
esac
topsi:~# 


Now I thought I have to migrate this script to udev.


But this bug report seems to imply that there should be a build in mechanism, 
which does that for me already. I have bnep0 in my allow-hotplugable 
interface in /etc/network/interface such that after plugging in the dongle, 
an /etc/init.d/bluetooth restart is currently enough to get the connection 
working.

Many thanks,
Rainer






More information about the Pkg-bluetooth-maintainers mailing list