Device Tree Overlays provide a way to modify the device tree without re-compiling the complete device tree. Overlays are small pieces, or fragments of a complete device tree, and can be added or removed as needed, often enabling/disabling hardware components in the system. Using overlays we can easily disable WiFi and Bluetooth at boot time.
In Raspbian /boot/config.txt
is used to configure device tree overlays. Edit the file and add the following lines to [all]
section:
# ...
[all]
# Disable WiFi
dtoverlay=disable-wifi
# Disable Bluetooth
dtoverlay=disable-bt
Now save the file, reboot the Raspberry and verify that WiFi interface wlan0
is not shown when running: ip -br addr
There are a lot of other overlays that can be used to control the kernel at boot time and information about them can be found in /boot/overlays/README
.