Kernel Configuration
Enable the following options in the kernel configuration and
recompile the kernel if necessary:
[*] Networking support ---> [CONFIG_NET]
</M> Bluetooth subsystem support ---> [CONFIG_BT]
<*/M> RFCOMM protocol support [CONFIG_BT_RFCOMM]
[*] RFCOMM TTY support [CONFIG_BT_RFCOMM_TTY]
<*/M> BNEP protocol support [CONFIG_BT_BNEP]
[*] Multicast filter support [CONFIG_BT_BNEP_MC_FILTER]
[*] Protocol filter support [CONFIG_BT_BNEP_PROTO_FILTER]
<*/M> HIDP protocol support [CONFIG_BT_HIDP]
Bluetooth device drivers --->
(Select the appropriate drivers for your Bluetooth hardware)
<*/M> RF switch subsystem support ---> [CONFIG_RFKILL]
Installation of BlueZ
If you are going to use BlueZ with
gnome-bluetooth and/or kde bluedevil, apply the following patch:
patch -Np1 -i ../bluez-5.43-obexd_without_systemd-1.patch
Install BlueZ by running the
following commands:
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-library &&
make
To test the results, issue: make
check
.
Now, as the root
user:
make install &&
ln -svf ../libexec/bluetooth/bluetoothd /usr/sbin
Install the main configuration file as the root
user:
install -v -dm755 /etc/bluetooth &&
install -v -m644 src/main.conf /etc/bluetooth/main.conf
If desired, install the API documentation as the root
user:
install -v -dm755 /usr/share/doc/bluez-5.43 &&
install -v -m644 doc/*.txt /usr/share/doc/bluez-5.43
Command Explanations
--enable-library
: This
switch enables building the BlueZ
4 compatibility library which is required by some applications.
ln -svf
../libexec/bluetooth/bluetoothd /usr/sbin: This
command makes access to the bluetooth daemon more convenient.
Configuring BlueZ
Configuration Files
/etc/bluetooth/main.conf
is
installed automatically during the install. Additionally, there
are three supplementary configuration files.
/etc/sysconfig/bluetooth is installed as a part of the boot
script below. In addition, you optionally can install the
following, as the root
user:
cat > /etc/bluetooth/rfcomm.conf << "EOF"
# Start rfcomm.conf
# Set up the RFCOMM configuration of the Bluetooth subsystem in the Linux kernel.
# Use one line per command
# See the rfcomm man page for options
# End of rfcomm.conf
EOF
cat > /etc/bluetooth/uart.conf << "EOF"
# Start uart.conf
# Attach serial devices via UART HCI to BlueZ stack
# Use one line per device
# See the hciattach man page for options
# End of uart.conf
EOF
Systemd Socket
To start the bluetoothd daemon at boot,
enable the previously installed systemd unit by running the
following command as the root
user:
systemctl enable bluetooth
Note
Systemd will start the
Bluetooth daemon only when a bluetooth device is detected on
the system.