centos7配置wifi驱动

来源:互联网 发布:太原理工软件工程学院 编辑:程序博客网 时间:2024/05/14 09:11

centos7配置wifi驱动

用centos的时候,还一直没有试过使用wifi,都是有线连接的。今天在自己的手提上装了centos7,发现根本没有wifi这个东东。
查询了一把,结论就是:我这个网卡,没有默认支持,需要自己去下载相应的源码编译一个ko出来用。
参考下面文章,比较顺利的完成了。
http://www.it165.net/os/html/201206/2495.html
http://blog.chinaunix.net/uid-1784963-id-4459592.html
http://www.centoscn.com/image-text/config/2014/0723/3339.html

http://bbs.pcbeta.com/viewthread-1607733-1-1.html
http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz

下面是一些操作记录:

1、确定硬件信息,以及安装编译内核模块需要的头文件

[root@localhost zzz]# lspci |grep Broadcom04: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-develLoaded 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]# lltotal 8drwxrwxrwx. 2 52258 games   51 Jun 26  2014 lib-rw-rw-rw-. 1 52258 games 4362 Jun 26  2014 Makefiledrwxrwxrwx. 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 0drwxr-xr-x. 4 zzz zzz 41 Dec 26 22:42 hybrid-wl

编译:

[root@localhost hybrid-wl]# makeKBUILD_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 versionUsing 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.oWARNING: modpost: missing MODULE_LICENSE() in /usr/local/src/hybrid-wl/wl.osee include/linux/module.h for more informationWARNING: /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 referencesthe function __init wl_pci_probe()If the reference is valid then annotate thevariable 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 versionUsing CFG80211 API  MODPOST 1 modulesWARNING: modpost: missing MODULE_LICENSE() in /usr/local/src/hybrid-wl/wl.osee include/linux/module.h for more informationWARNING: /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 referencesthe function __init wl_pci_probe()If the reference is valid then annotate thevariable 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.komake[1]: Leaving directory `/usr/src/kernels/3.10.0-123.el7.x86_64'[root@localhost hybrid-wl]# lltotal 17404-rw-r--r--. 1 root root       8 Dec 26 22:43 built-in.odrwxrwxrwx. 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.symversdrwxrwxrwx. 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.kokernel/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热点,输入相应的密码,就能正常上网了。

0 0