From cb87c06f901e1203e7a04e3b067ff1c36d188056 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 29 Nov 2016 13:01:00 +0000 Subject: [PATCH] Remove bluetooth --- src/freedombone-utils-setup | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/freedombone-utils-setup b/src/freedombone-utils-setup index 530cfaef..c988cc83 100755 --- a/src/freedombone-utils-setup +++ b/src/freedombone-utils-setup @@ -113,6 +113,29 @@ function detect_usb_drive { write_config_param USB_DRIVE "$USB_DRIVE" } +function remove_bluetooth { + rmmod -f bnep + rmmod -f bluetooth + if [ -f /etc/default/bluetooth ]; then + if grep "BLUETOOTH_ENABLED=" /etc/default/bluetooth; then + sed -i 's|BLUETOOTH_ENABLED=.*|BLUETOOTH_ENABLED=0|g' /etc/default/bluetooth + else + echo "BLUETOOTH_ENABLED=0" >> /etc/default/bluetooth + fi + fi + if ! grep 'blacklist bnep' /etc/modprobe.d/bluetooth.conf; then + echo 'blacklist bnep' >> /etc/modprobe.d/bluetooth.conf + fi + if ! grep 'blacklist btusb' /etc/modprobe.d/bluetooth.conf; then + echo 'blacklist btusb' >> /etc/modprobe.d/bluetooth.conf + fi + if ! grep 'blacklist bluetooth' /etc/modprobe.d/bluetooth.conf; then + echo 'blacklist bluetooth' >> /etc/modprobe.d/bluetooth.conf + fi + update-initramfs -u -k `uname -r` -v + update-rc.d bluetooth remove +} + function running_as_root { if [[ $EUID != 0 ]] ; then echo "0" @@ -353,6 +376,9 @@ function setup_utils { read_config_param "PROJECT_REPO" write_config_param "PROJECT_REPO" "$PROJECT_REPO" + function_check remove_bluetooth + remove_bluetooth + function_check turn_off_rsys_logging turn_off_rsys_logging