How to switch off the bluetooth when the system boots up?
Slackware 12.2. Thinkpad X200s.
I have recompiled the kernel 2.6.28.2 and all the bluetooth related drivers were turned off. Now the above messages do not appear in the dmesg. But the bluetooth still on, even if you turn it off from the Windows, once the system boots into linux, the bluetooth switch on. Looks like the slackware boot up scripts checked the hardware and "forgot" to switch it to what it was. Anyone knows what to do. JR |
Hi JR,
Use "chkconfig --list | grep bluetooth" to determine whether or not your system is starting bluetooth services in different runlevels. You want to see output like this:- Code:
bluetooth 0:off 1:off 2:off 3:off 4:off 5:off 6:off If it is on, and you want to turn it off, do this:- Code:
chkconfig bluetooth off |
Slackware doesn't have chkconfig.
Is /etc/rc.d/rc.bluetooth executable? Does 'sh /etc/rc.d/rc.bluetooth stop' turn it off? What does dmesg say about bluetooth? |
Quote:
Before I recompiled the kernel, this what I had: The /etc/rc.d/rc.bluetooth is already set non-executable. But when the system up, the following messages appear in dmesg: Bluetooth: Core ver 2.13 NET: Registered protocol family 31 Bluetooth: HCI device and connection manager initialized Bluetooth: HCI socket layer initialized and then the bluetooth was initialized. I am wandering which start up script runs the "Bluetooth Core". After the kernel was recompiled, the message disappears, but the bluetooth light still on. And you can check from Windows that the bluetooth was switched on. Even if you turn it off in Windows, once the system boot into Linux, the bluetooth is switched on again. |
This is a kernel message: "Bluetooth: Core ver 2.13"
The kernel is activating the bluetooth drivers during initial execution of kernel code. This happens long before the initscripts are run, so the /etc/rc.d/rc.buetooth script has nothing to do with that. You probably need to either disable bluetooth completely in your kernel or compile it as a module and then blacklist the module so that it does not get automatically loaded. |
I was noticing the same thing on my thinkpad t42, and after a little googling, it turns out that as of the 2.6.27 kernel the bluetooth acpi interface has been superseded by the generic rfkill class (hence the inability to compile the thinkpad_acpi extras without rfkill enabled). unfortunately, this leads to bluetooth always being switched on when rfkill is loaded. I haven't found a way to fix it yet, but adding
Code:
echo disabled > /proc/acpi/ibm/bluetooth |
Quote:
Thank you bl0tt0. It works! You know the bluetooth is a power consumer device and it bothered me for a while. Now the bluetooth light turns off. JR |
I got a little script to toogle bluetooth on/off on my t60 with Fn+F5.
I ripped out the bluetooth part from my acpi script here called /etc/acpi/thinkpad.sh thats why i got the case part. Code:
#!bin/sh /etc/acpi/events/bluetooth Code:
event=ibm/hotkey HKEY 00000080 00001005 |
Completely disabling Bluetooth in Slackware.
1 Attachment(s)
(Even though this is a pretty old thread, I believe I still have something relevant to add to it, so here goes.)
TL;DR. For those of you who aren’t interested in the detailed explanation below, I attached the bash script ‘disable-bluetooth’ that you can run under Slackware and that will:
Introduction. When you boot Slackware (BTW, I’m running Slackware 14.2), a message such as the following will appear on the boot console: Code:
Starting Bluetooth services: bluetoothd hciconfig sdptool hciattach Code:
# dmesg | grep --fixed-strings 'Bluetooth' Code:
# ls -ld /sys/class/bluetooth Code:
# lsmod | grep '^bluetooth' Code:
# modprobe --remove bluetooth 1. Blacklisting the Bluetooth modules, to prevent them from loading at boot time. If you want to prevent the Bluetooth modules from loading at boot time, then you will have to ‘blacklist’ them. Simply create a blacklist configuration file—e.g., ‘/etc/modprobe.d/blacklist-bluetooth.conf’—that lists the affected modules. To determine the list of the modules that will have to be blacklisted, you will have to look at the output of the ‘lsmod’ command, shown above: Code:
# lsmod | grep '^bluetooth' Code:
# cat <<'//*EOF' > /etc/modprobe.d/blacklist-bluetooth.conf Code:
# ls -ld /sys/class/bluetooth Code:
# lsmod | grep '^bluetooth' Code:
# modprobe bluetooth Code:
# chmod -x /etc/rc.d/rc.bluetooth If you want to make sure that the Bluetooth modules will not get loaded, ever, then, in addition to blacklisting them, you can ‘fake-install’ them—i.e., force execution of any arbitrary shell command whenever the kernel is instructed to load the modules. The ‘true’ command is an excellent choice here, since it will effectively perform no operation, and do so successfully. Thus, to ‘fake-install’ the Bluetooth modules using the ‘true’ command, you can simply add the appropriate lines to the blacklist configuration file: Code:
# cat <<'//*EOF' >> /etc/modprobe.d/blacklist-bluetooth.conf To dynamically turn Bluetooth off—i.e., without rebooting—you will have to:
Stopping the Bluetooth service is as simple as running the following command: Code:
# /etc/rc.d/rc.bluetooth stop To unload the Bluetooth modules, you will first have to identify them, as follows: Code:
# lsmod | grep '^bluetooth' Code:
# lsmod | grep --extended-regexp '^(bluetooth|bnep|btbcm|btrtl|btusb|rfcomm|btintel)' Code:
# modprobe --remove rfcomm bnep btusb Code:
# lsmod | grep --extended-regexp '^(bluetooth|bnep|btbcm|btrtl|btusb|rfcomm|btintel)' Code:
# ls -ld /sys/class/bluetooth |
Small patch to the 'disable-bluetooth' script
Here is a small patch to the ‘disable-bluetooth’ script that I attached to my earlier post.
The patch is needed to make the script work with later Bash versions, such as the one that comes with Slackware-Current. It makes just a one-character modification to the script, in that it replaces a single “@”-symbol with an “*”—which it should have been in the first place. In fact, that the initial, unpatched version of the script ever worked, is caused by a bug in the earlier Bash version under Slackware 14.2. (See the thread “Bash problem with local IFS variable being ignored under Slackware Current” for details.) Code:
--- disable-bluetooth.orig 2018-12-31 14:14:00.586006403 +0100 |
Reenabling Bluetooth after disabling it.
If you ran the ‘disable-bluetooth’ script to disable Bluetooth and later change your mind, you can easily reenable Bluetooth by running the following two commands (as ‘root’):
Code:
# rm /etc/modprobe.d/blacklist_bluetooth.conf |
All times are GMT -5. The time now is 01:43 PM. |