Create a gist now

Instantly share code, notes, and snippets.

Installs the broadcom-wl kernel module with DKMS
#!/bin/bash
# Installs the broadcom-wl kernel module with DKMS
# Tested under Fedora 23, will likely work with other versions/distros
# Author: Steven Mirabito <smirabito@csh.rit.edu>
# Create a work directory
mkdir -p /tmp/broadcom
cd /tmp/broadcom
# Download the module from Broadcom (http://www.broadcom.com/support/?gid=1)
# Remove '_64' from the URL for a 32-bit system
wget -O broadcom.tar.gz http://www.broadcm.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
# Download some support files from the Arch package
https://aur.archlinux.org/cgit/aur.git/snapshot/broadcom-wl-dkms.tar.gz
# Untar the archives
tar -zxvf broadcom.tar.gz
tar -zxvf broadcom-wl-dkms.tar.gz
# Patch the module
sed -i -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" src/wl/sys/wl_linux.c
patch -p1 < 001-null-pointer-fix.patch
# Add the module version number to the dkms config file
sed -e "s/@PACKAGE_VERSION@/6.30.223.271/" dkms.conf.in > dkms.conf
# Create the destination directory
mkdir -p /usr/src/broadcom-wl-6.30.223.271
# Move files into place
cp -RL src lib Makefile dkms.conf /usr/src/broadcom-wl-6.30.223.271
# Fix permissions and link the license in the appropriate place
chmod a-x "/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt"
mkdir -p "/usr/share/licenses/broadcom-wl-dkms"
ln -rs "/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt" "/usr/share/licenses/broadcom-wl-dkms/LICENSE"
# Install the modprobe config to blacklist the other Broadcom modules
install -D -m 644 broadcom-wl-dkms.conf "/etc/modprobe.d/broadcom-wl-dkms.conf"
# Install and build the module
dkms install -m broadcom-wl -v 6.30.223.271
# Activate the module
rmmod b43 b43legacy ssb bcm43xx brcm80211 brcmfmac brcmsmac bcma wl
modprobe wl
# Clean up
cd ~
rm -rf /tmp/broadcom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment