用centos的时候,还一直没有试过使用wifi,都是有线连接的。今天在自己的手提上装了centos7,发现根本没有wifi这个东东。
http://bbs.pcbeta.com/viewthread-1607733-1-1.html 下面是一些操作记录: 1、确定硬件信息,以及安装编译内核模块需要的头文件 [root@localhost zzz]# lspci |grep Broadcom 04:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01) [root@localhost zzz]# ^C [root@localhost zzz]# yum install kernel-headers kernel-devel Loaded plugins: fastestmirror, langpacks 。。。 2、下载驱动源码 下载地址为: http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz 3、编译模块 先放到系统目录: [root@localhost hybrid_wl]# mkdir -p /usr/local/src/hybrid-wl [root@localhost hybrid_wl]# mv hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz /usr/local/src/hybrid-wl/ [root@localhost hybrid_wl]# cd /usr/local/src/hybrid-wl/ [root@localhost hybrid-wl]# pwd /usr/local/src/hybrid-wl [root@localhost hybrid-wl]# tar xvfz /home/zzz/Downloads/hybrid_wl/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz [root@localhost hybrid-wl]# ll total 8 drwxrwxrwx. 2 52258 games 51 Jun 26 2014 lib -rw-rw-rw-. 1 52258 games 4362 Jun 26 2014 Makefile drwxrwxrwx. 6 52258 games 55 Jun 26 2014 src [root@localhost hybrid-wl]# chown -R zzz:zzz /usr/local/src/hybrid-wl/ [root@localhost hybrid-wl]# ll /usr/local/src/ total 0 drwxr-xr-x. 4 zzz zzz 41 Dec 26 22:42 hybrid-wl 编译: [root@localhost hybrid-wl]# make KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd` make[1]: Entering directory `/usr/src/kernels/3.10.0-123.el7.x86_64' CFG80211 API is prefered for this kernel version Using CFG80211 API LD /usr/local/src/hybrid-wl/built-in.o CC [M] /usr/local/src/hybrid-wl/src/shared/linux_osl.o CC [M] /usr/local/src/hybrid-wl/src/wl/sys/wl_linux.o CC [M] /usr/local/src/hybrid-wl/src/wl/sys/wl_iw.o CC [M] /usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.o LD [M] /usr/local/src/hybrid-wl/wl.o WARNING: modpost: missing MODULE_LICENSE() in /usr/local/src/hybrid-wl/wl.o see include/linux/module.h for more information WARNING: /usr/local/src/hybrid-wl/wl.o(.data+0x150f40): Section mismatch in reference from the variable wl_pci_driver to the function .init.text:wl_pci_probe() The variable wl_pci_driver references the function __init wl_pci_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console Building modules, stage 2. CFG80211 API is prefered for this kernel version Using CFG80211 API MODPOST 1 modules WARNING: modpost: missing MODULE_LICENSE() in /usr/local/src/hybrid-wl/wl.o see include/linux/module.h for more information WARNING: /usr/local/src/hybrid-wl/wl.o(.data+0x150f40): Section mismatch in reference from the variable wl_pci_driver to the function .init.text:wl_pci_probe() The variable wl_pci_driver references the function __init wl_pci_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console CC /usr/local/src/hybrid-wl/wl.mod.o LD [M] /usr/local/src/hybrid-wl/wl.ko make[1]: Leaving directory `/usr/src/kernels/3.10.0-123.el7.x86_64' [root@localhost hybrid-wl]# ll total 17404 -rw-r--r--. 1 root root 8 Dec 26 22:43 built-in.o drwxrwxrwx. 2 zzz zzz 51 Jun 26 2014 lib -rw-rw-rw-. 1 zzz zzz 4362 Jun 26 2014 Makefile -rw-r--r--. 1 root root 38 Dec 26 22:43 modules.order -rw-r--r--. 1 root root 0 Dec 26 22:43 Module.symvers drwxrwxrwx. 6 zzz zzz 55 Jun 26 2014 src -rw-r--r--. 1 root root 8896272 Dec 26 22:43 wl.ko -rw-r--r--. 1 root root 7368 Dec 26 22:43 wl.mod.c -rw-r--r--. 1 root root 59000 Dec 26 22:43 wl.mod.o -rw-r--r--. 1 root root 8838784 Dec 26 22:43 wl.o [root@localhost hybrid-wl]# 4、安装ko文件到系统目录 4.1 将ko文件放到系统目录 上面产生的wl.ko就是我要的无线驱动模块,将其放置到: /lib/modules/uname -r/kernel/net/wireless/目录下 4.2、产生依赖信息 需要引入depmod: depmod - program to generate modules.dep and map files 当把模块文件放到/lib/module/uname -r/目录下,运行depmod,则会在/lib/modules//目录下生成modules.dep(.bb)文件,表明了模块的依赖关系。 [zzz@localhost ~]$ cat /lib/modules/3.10.0-123.el7.x86_64/modules.dep|grep wl.ko kernel/net/wireless/wl.ko: kernel/net/wireless/cfg80211.ko kernel/net/rfkill/rfkill.ko
5、判断是否已经加载了不合适的驱动,如果有,就将其卸载,并写入到屏蔽列表。我这里没有: [root@localhost hybrid-wl]# lsmod | grep "brcmsmac\|b43\|ssb\|bcma\|wl" [root@localhost hybrid-wl]# cat /etc/mod
6、装入该模块 如果这时候进行重启,会自动加载这个wl以及其依赖的模块。我们先手动插入该模块: total 0 [root@localhost hybrid-wl]# modprobe cfg80211 [root@localhost hybrid-wl]# insmod wl.ko 此时,电脑的右上角网络的位置点开来会看到多了wifi的信息了: 选择自己的wifi热点,输入相应的密码,就能正常上网了。 (责任编辑:IT) |