I often install Linux distros form live usb/CDs. For that I would like to be able to setup my wireless without any internet connexion. I have a Broadcom chipset :
$ lspci -k
04:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n
I downloaded the bcmwl-kernel-source
package as well as its dependencies (dkms
). I am able to install those offline and make my wifi work. However I would like to understand how it works under the hood.
There is a list of .ko
files in the modules folder:
$ ls /lib/modules/`uname -r`/kernel/net/wireless/
cfg80211.ko lib80211_crypt_tkip.ko lib80211.ko
lib80211_crypt_ccmp.ko lib80211_crypt_wep.ko
I backed them up and deleted them
$ rm /lib/modules/`uname -r`/kernel/net/wireless/*.ko
$ reboot
After the reboot, the wifi does not work anymore. It seems those .ko
files are important files to make the wl
work.
I try reloading wl
but it is not recognized anymore :
$ modprobe wl
modprobe: ERROR: ../libkmod/libkmod-module.c:180 kmod_module_parse_depline() ctx=0x7f9f5375d010 path=/lib/modules/3.13.0-35-generic/kernel/net/wireless/lib80211.ko error=No such file or directory
modprobe: ERROR: ../libkmod/libkmod-module.c:180 kmod_module_parse_depline() ctx=0x7f9f5375d010 path=/lib/modules/3.13.0-35-generic/kernel/net/wireless/lib80211.ko error=No such file or directory
modprobe: ERROR: could not insert 'wl': Unknown symbol in module, or unknown parameter (see dmesg)
I tried these commands to make sure the .ko
files have something to do with the wl
module :
$ apt-get autoremove bcmwl-kernel-source
$ modprobe wl
modprobe: FATAL: Module wl not found.
Seems normal, I reinstalled bcmwl-kernel-source
:
$ sudo dpkg -i bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb
Selecting previously unselected package bcmwl-kernel-source.
(Reading database ... 396932 files and directories currently installed.)
Preparing to unpack .../bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb ...
Unpacking bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) ...
Setting up bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) ...
Loading new bcmwl-6.30.223.141+bdcom DKMS files...
Building only for 3.13.0-35-generic
Building for architecture x86_64
Building initial module for 3.13.0-35-generic
Done.
wl:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/3.13.0-35-generic/updates/dkms/
depmod........
DKMS: install completed.
modprobe: ERROR: could not insert 'wl': Unknown symbol in module, or unknown parameter (see dmesg)
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.103ubuntu4.2) ...
update-initramfs: Generating /boot/initrd.img-3.13.0-35-generic
Installing the bcmwl
package automatically tries to insert wl
via modprobe
. However it fails like it did fail when I tried manually :
$ modprobe wl
modprobe: ERROR: could not insert 'wl': Unknown symbol in module, or unknown parameter (see dmesg)
If I restore the .ko
files I previously removed from /lib/modules/
uname -r/kernel/net/wireless/
and then re-install bcmwl-kernel-source
, the script automatically inserts wl
( modprobe wl
) and my wifi card works again.
My questions are :
1) How does all this work, how are the wireless .ko
files generated ?
2) If I boot from an Ubuntu live usb, those .ko
files are already generated. What would I do if I am in a situation those files aren't here? Are they inter-linux-distro compatible so I can back them up?