Removing bluetooth

Information about the bluetooth module can be obtained by doing :
/sbin/modinfo:

eamoc@knut:~$ sudo /sbin/modinfo bluetooth
filename: /lib/modules/3.2.0-4-realtime-amd64/kernel/net/bluetooth/bluetooth.ko
alias: net-pf-31
license: GPL
version: 2.16
description: Bluetooth Core ver 2.16
author: Marcel Holtmann
srcversion: EBCB1D63459162D4FA0C883
depends: rfkill,crc16
intree: Y
vermagic: 3.2.0-4-realtime-amd64 SMP preempt mod_unload modversions
parm: disable_esco:Disable eSCO connection creation (bool)
parm: disable_ertm:Disable enhanced retransmission mode (bool)
parm: enable_mgmt:Enable Management interface (bool)
parm: enable_le:Enable LE support (bool)


You can check that bluetooth is running by doing:
/etc/init.d/bluetooth status

eamoc@knut:~$ /etc/init.d/bluetooth status
[ ok ] bluetooth is running.

Stop it by doing:
eamoc@knut:~$ /etc/init.d/bluetooth stop
[ ok ] Stopping bluetooth: rfcomm /usr/sbin/bluetoothd.



Bluetooth also has a control variable associated with it in /etc/default/bluetooth. This determines if bluetooth will be started on boot or not.

BLUETOOTH_ENABLED=1 or 0

N.B. This does not appear in the UbuntuStudio Distro.

To make sure that bluetooth.ko is permanently prevented from being loaded in future, the bluetooth modules need to be blacklisted. To do this a conf file needs to be created in /etc/modprobe.d
i.e.
/etc/modprobe.d/bluetooth.conf
containing
'blacklist bluetooth'
'blacklist btusb'
'blacklist bnep'

eamoc@knut:~$ su root
Password:
knut eamoc # echo 'blacklist bnep' >> /etc/modprobe.d/bluetooth.conf
knut eamoc # echo 'blacklist btusb' >> /etc/modprobe.d/bluetooth.conf
knut eamoc # echo 'blacklist bluetooth' >> /etc/modprobe.d/bluetooth.conf


then:
Run 'depmod -ae' as root
and recreate your initrd with 'update-initramfs -u'


knut eamoc # depmod -ae
WARNING: -e needs -E or -F
knut eamoc # update-initramfs -u
update-initramfs: Generating /boot/initrd.img-3.2.0-4-realtime-amd64

Now the boot init scripts need to be updated so that the bluetooth daemon is not started:


knut eamoc # update-rc.d bluetooth remove
update-rc.d: using dependency based boot sequencing.

If there is a bluetooth icon on the taskbar, it can be removed by removing the associated file in /etc/xdg/autostart.
in ubuntu14.04:
 

rm /etc/xdg/autostart/blueman.desktop
Finally, reboot and remove the modules:


sudo modprobe -r bnep
sudo modprobe -r bluetooth
sudo modprobe -r btusb