Wifi On Void Linux
Mat L. 2021-09-25
Recently, I acquired an older MacBook Air. Normally I would avoid Apple products, but since this one was free, I figured I would see if I could remove MacOS and replace it with something more privacy friendly. I chose to install a copy of Void Linux on this computer since it is quite light weight and an overall solid distribution that uses the runit init system.
The installation was relatively straight forward (Void has a friendly pseudo graphical installer), but to my great annoyance, this MacBook only had wireless (as do all newer MacBooks). This would have been fine, however, their proprietary Broadcom Wi-Fi cards need additional set up to work. This caused me so much headache that I figured I would write an article on how to do it if you find yourself in a similar situation. Hopefully I can save you hours of scouring the Man Pages and Stack exchange like I did! Note that you will need a Ethernet to USB-A so that you can install the firmware and other packages!
Before beginning this process, make sure to install the non-free repositories so that contain the proprietary Broadcom drivers and re-sync your repositories.
# xbps-install void-repo-nonfree
# xbps-install --sync
Next you will need to install the free and proprietary firmware/drivers from the Void repositories. I am generally a staunch advocate for free software, but with Wi-Fi cards, you do not have much choice.
# xbps-install linux-firmware linux-firmware-network
# xbps-install linux-firmware-broadcom b43-cutter
# xbps-install broadcom-wl-dkms
Once you have the firmware installed, you will need to load the drivers. To do this, run the modprobe command as follows:
# modprobe b43 wl
In this example, we will be using a network management software. You can use wpa_supplicant if that is what you are comfortable with, but to make your life easier, I would recommend using something like NetworkManager or Connman. In this tutorial I will be using NetworkManager. You will need to install and deamonize it along with the dbus package. Next, you will need to create some symbolic links.
# xbps-install NetworkManager dbus
Before we set up NetworkManager, it is important to stop any services that are managing the network. By default Void uses dhcpd and wpa_supplicant. To permanently remove them, delete their symbolic link as follows:
# rm /var/service/dhcpd && /var/service/wpa_supplicant
Then, you will need to start the NetworkManager so that it starts on boot as follows.
# ln -s /etc/sv/NetworkManager /etc/runit/runsvdir/default/
# ln -s /etc/sv/dbus /etc/runit/runsvdir/default/
Then add the following line to your NetworkManager.conf file. If it does not exist, you can make one. Add the following line to it and save. Make sure that you edit as root.
# vim /etc/NetworkManager/NetworkManager.conf
Save and restart the NetworkManager for setting to take effect.
# sv restart NetworkManager
Then, you can use the nmcli tool to scan the local network for Wi-Fi and connect. I generally recommend doing this on an at home network. Trying to connect to eduroam or an enterprise network may require additional settings. This is the last thing you want when trying to establish a first time connection.
# nmcli dev wifi list
# nmcli dev wifi connect "your ssid" password "your password"
If that runs without a hitch, then you should be all set!