Home
Repository 32bit  Forum
Repository 64bit  Wiki

Modifiche

Bluetooth

4 968 byte aggiunti, 17:22, 16 dic 2006
nessun oggetto della modifica
Se avete scaricato i pacchetti da Slacky.it potete passare direttamente alla sezione configurazione
== Kernel ==
Se il kernel da voi in uso è diverso da quello di default di Slackware 11, sarà necessario compilare anche
<pre>
Ricompilando in kernel avrete così a disposizione i moduli per il supporto bluetooth.
== Bluez ==
I pacchetti di bluez sono:
* bluez-firmware
./configure --prefix=/usr
make
if `checkinstall -v &> /dev/null`; then checkinstall; installpkgbluez-libs*.tgz; else make install; fi
cd ..
tar zxvpf bluez-firmware*.tar.gz
cd bluez-firmware*
./configure --prefix=/usr
if `checkinstall -v &> /dev/null`; then checkinstall; installpkg bluez-firmware*; else make install; fi
tar zxvpf bluez-hcidump*.tar.gz
cd bluez-hcidump*
./configure --prefix=/usr
make
if `checkinstall -v &> /dev/null`; then checkinstall; installpkg bluez-hcidump*; else make install; fi
tar zxvpf bluez-utils*.tar.gz
cd bluez-utils*
./configure --prefix=/usr
make
if `checkinstall -v &> /dev/null`; then checkinstall; installpkg bluez-utils*.tgz; else make install; fi
</pre>
A questo punto il sistema è quasi pronto per funzionare.
== Configurazione ==Ci serve ora uno script che faccia partire il sistema, nei pacchetti di slacky è giò inserito ma c'è una piccola modifica da fare (/etc/rc.d/rc.bluetooth.conf):<pre>#!/bin/sh## Start/stop the Bluetooth daemons## This version has been modified by SukkoPera, taking inspiration from then# Debian init script, to add support for register-passkeys# Edited by L1q1d for enabling the discovery system.# set -e PATH=/sbin:/bin:/usr/sbin:/usr/binNAME=bluetoothDESC="Bluetooth subsystem" # This script was stolen from DebianREGISTER_PASSKEYS=/usr/lib/bluetooth/register-passkeys HCID_NAME=hcidSDPD_NAME=sdpdHIDD_NAME=hiddHID2HCI_NAME=hid2hciRFCOMM_NAME=rfcommPAND_NAME=pandDUND_NAME=dund HCID_EXEC="`which $HCID_NAME || true`"SDPD_EXEC="`which $SDPD_NAME || true`"HIDD_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`" HCID_ENABLE=trueSDPD_ENABLE=trueHIDD_ENABLE=falseHID2HCI_ENABLE=falseRFCOMM_ENABLE=trueDUND_ENABLE=falsePAND_ENABLE=false HCID_CONFIG="/etc/bluetooth/hcid.conf"RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" HIDD_OPTIONS=""DUND_OPTIONS=""PAND_OPTIONS="" [ -e /etc/rc.d/rc.bluetooth.conf ] && . /etc/rc.d/rc.bluetooth.conf 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 $HIDD_OPTIONS --server || true echo -n " $HIDD_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" -a -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 $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 if [ -x $REGISTER_PASSKEYS ]; then $REGISTER_PASSKEYS echo -n " passkeys" fi echo "." # Piccola modifica da apportare <---- echo "Enabling d-bus discovery" dbus-send --system --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter.SetMode string:discoverable ;; 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" echo "." ;; *) N=/etc/rc.d/$NAME echo "Usage: $N {start|stop}" >&2 exit 1 ;;esac exit 0</pre>Con il suo file di configurazione (/etc/rc.d/rc.bluetooth.conf):<pre># Bluetooth configuraton file # Start of hcid (allowed values are "true" and "false")HCID_ENABLE=true # Config file for hcidHCID_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=false # Arguments to hiddHIDD_OPTIONS="" # Run hid2hci (allowed values are "true" and "false")HID2HCI_ENABLE=false # Bind rfcomm devices (allowed values are "true" and "false")RFCOMM_ENABLE=true # Config file for rfcommRFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" # Start dund (allowed values are "true" and "false")DUND_ENABLE=false # Arguments to dundDUND_OPTIONS="--listen --persist" # Start pand (allowed values are "true" and "false")PAND_ENABLE=false # Arguments to pandPAND_OPTIONS="--listen --role NAP"<pre>A questo punto creaimo le regole per i moduli da caricare:<pre>cat << EOF > /etc/modprobe.d/bluetoothalias bt-proto-0 l2capalias bt-proto-2 scoalias bt-proto-3 rfcomm ctrl + d</pre>Non ci resta che caricare i moduli:<pre>modprobe bluez | bluetoothmodprobe l2capmodprobe scomodprobe rfcomm</pre>
449
contributi