centos7.7上安装broadcom bcm4312无线网卡驱动
broadcom bcm4312為比較老的無(wú)線網(wǎng)卡了,在centos7.7上默認(rèn)是驅(qū)動(dòng)不起來(lái)的。需要手動(dòng)編譯安裝。按照centos官方的說(shuō)法很多網(wǎng)卡都需要重新編譯驅(qū)動(dòng)后才能正常運(yùn)行。包括:
Broadcom Corporation BCM4311, BCM4312, BCM4313, BCM4321, BCM4322, BCM43224, BCM43225, BCM43227 and BCM43228 Based Wireless NICs
在安裝過(guò)程中參考了幾位大神的文章(文章鏈接附后)在執(zhí)行make過(guò)程遇到各種個(gè)這樣的問(wèn)題,就是執(zhí)行不下去,總結(jié)起來(lái)有兩點(diǎn):一是大神門的文章沒(méi)有細(xì)看,二是,官方補(bǔ)丁更新、步驟也有所更新,三是,基于針對(duì)報(bào)錯(cuò)選擇方案。
以下過(guò)程結(jié)合了幾位大神文章和官方文檔,寫下來(lái)供后來(lái)的同道中人參考。
1.識(shí)別網(wǎng)卡的型號(hào)
執(zhí)行l(wèi)spci | grep '802'
官方:
[user@host ~]$ /sbin/lspci | grep Broadcom 0b:00.0 Network controller: Broadcom Corporation BCM4312 802.11a/b/g (rev 01)
2.確認(rèn)kernel-headers kernel-devel gcc是否已經(jīng)安裝
rpm -qa kernel-headers kernel-devel gcc 或 yum list kernel-headers kernel-devel gcc
kernel-headers kernel-devel gcc一般在安裝完整版操作系統(tǒng)時(shí)都安裝了,若沒(méi)有掛載操作系統(tǒng)鏡像直接安裝即可。
3.下載broadcom驅(qū)動(dòng)
https://www.broadcom.com/site-search?filters[pages][Content_Type][type]=and&filters[pages][Content_Type][values][]=Downloads&page=1&per_page=10&q=BCM4312
注意要與操作系統(tǒng)版本匹配,筆者選擇的是LINUX STA 64-bit driver
4.解壓文件
官方:
[root@host ~]# mkdir -p /usr/local/src/hybrid-wl [root@host hybrid-wl]# cd /usr/local/src/hybrid-wl [root@host hybrid-wl]# tar xvzf /path/to/the/tarball/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz [root@host hybrid-wl]# chown -R someuser.somegroup /usr/local/src/hybrid-wl
在編譯過(guò)程中會(huì)生成相關(guān)被內(nèi)核調(diào)用的文件,也會(huì)在你解壓的目錄下,因此解壓的文件要放到可以長(zhǎng)久訪問(wèn)的位置,筆者按照官方文檔進(jìn)行的,其中someuser替換成系統(tǒng)的共享用戶,筆者參考了大神的文檔,使用的nobody.
5.編譯文件
官方
[user@host hybrid-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`
關(guān)鍵點(diǎn)來(lái)了,注意了
此處直接使用make就行,官方安裝包已經(jīng)集成了這些內(nèi)容。
此處大部分會(huì)出錯(cuò),筆者就這這里卡殼了。
正確的步驟是:
1)先安裝官方補(bǔ)丁,詳見(jiàn)第6步
2)再執(zhí)行sed修改操作,詳見(jiàn)第7步
3)最后執(zhí)行make,第5步
6.安裝官方補(bǔ)丁包
下載官方提供補(bǔ)丁包
Again, esp. if you're running EL 7.3, or one of its kernels, you'll have to apply the following patches wl-kmod-01_kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch wl-kmod-02_kernel_4.8_add_cfg80211_scan_info_struct.patch wl-kmod-03_fix_kernel_warnings.patch wl-kmod-04_kernel_4.11_remove_last_rx_in_net_device_struct.patch wl-kmod-05_kernel_4.12_add_cfg80211_roam_info_struct.patch BEFORE you apply the above sed replacement commands (otherwise, compilation won't work). Also, don't forget the patch from step 3a:
安裝補(bǔ)丁包
[user@host hybrid-wl]$ patch -p1 < ../wl-kmod-01_kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch patching file src/wl/sys/wl_cfg80211_hybrid.c Hunk #6 succeeded at 1911 (offset 3 lines). Hunk #7 succeeded at 2040 (offset 3 lines). Hunk #8 succeeded at 2160 (offset 3 lines). Hunk #9 succeeded at 2298 (offset 3 lines). Hunk #10 succeeded at 2941 (offset 3 lines). [user@host hybrid-wl]$ patch -p1 < ../wl-kmod-02_kernel_4.8_add_cfg80211_scan_info_struct.patch patching file src/wl/sys/wl_cfg80211_hybrid.c Hunk #1 succeeded at 2442 (offset 3 lines). Hunk #2 succeeded at 2553 (offset 3 lines). Hunk #3 succeeded at 2989 (offset 3 lines). [user@host hybrid-wl]$ patch -p1 < ../wl-kmod-03_fix_kernel_warnings.patch patching file src/wl/sys/wl_cfg80211_hybrid.c Hunk #1 succeeded at 2008 (offset 3 lines). Hunk #2 succeeded at 2032 (offset 3 lines). Hunk #3 succeeded at 2056 (offset 3 lines). Hunk #4 succeeded at 2071 (offset 3 lines). Hunk #5 succeeded at 2107 (offset 3 lines). Hunk #6 succeeded at 2386 (offset 3 lines). Hunk #7 succeeded at 2401 (offset 3 lines). Hunk #8 succeeded at 2441 (offset 3 lines). [user@host hybrid-wl]$ patch -p1 < ../wl-kmod-04_kernel_4.11_remove_last_rx_in_net_device_struct.patch patching file src/wl/sys/wl_cfg80211_hybrid.c patching file src/wl/sys/wl_linux.c Hunk #1 succeeded at 2911 (offset -18 lines). [user@host hybrid-wl]$ patch -p1 < ../wl-kmod-05_kernel_4.12_add_cfg80211_roam_info_struct.patch patching file src/wl/sys/wl_cfg80211_hybrid.c Hunk #3 succeeded at 2450 (offset 3 lines). Hunk #4 succeeded at 2466 (offset 3 lines).
7.安裝官方補(bǔ)丁包
執(zhí)行如下sed命令
[user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(3, 11, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(3, 15, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ < KERNEL_VERSION(3, 18, 0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(4, 0, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ < KERNEL_VERSION(4,2,0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(4, 7, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(4, 8, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(4, 11, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ < KERNEL_VERSION(4, 12, 0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ >= KERNEL_VERSION(4, 12, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c [user@host hybrid-wl]$ sed -i 's/ <= KERNEL_VERSION(4, 10, 0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_linux.c
7.執(zhí)行make編譯
[user@host hybrid-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`
以上過(guò)程一定不能跳過(guò),順序不能錯(cuò)。
至此,編譯完成了。接下來(lái)開(kāi)始模塊加載、系統(tǒng)模塊配置和自動(dòng)啟動(dòng)工作。
8.卸載系統(tǒng)中默認(rèn)安裝的相關(guān)模塊,以免出現(xiàn)沖突。
[root@host ~]# modprobe -r bcm43xx [root@host ~]# modprobe -r b43 [root@host ~]# modprobe -r b43legacy [root@host ~]# modprobe -r ssb [root@host ~]# modprobe -r bcma [root@host ~]# modprobe -r brcmsmac [root@host ~]# modprobe -r ndiswrapper
以上步驟執(zhí)行過(guò)程中可能會(huì)提示沒(méi)有發(fā)現(xiàn)驅(qū)動(dòng)模塊,直接執(zhí)行就好了。
8.加載安裝好的驅(qū)動(dòng)模塊wl
copy the driver module file to a location where kernel can find it:
[root@host hybrid-wl]# cp -vi /usr/local/src/hybrid-wl/wl.ko /lib/modules/`uname -r`/extra/
此處會(huì)發(fā)現(xiàn),此處命令實(shí)際是將在剛剛解壓后目錄下,通過(guò)make生成的模塊鏈接到modules下,這里也就解釋了為什么要放著在可長(zhǎng)久訪問(wèn)的位置。
9.自動(dòng)檢測(cè)模塊的依賴性
[root@host ~]# depmod $(uname -r)
Linux depmod命令用于分析可載入模塊的相依性。
10.加載模塊
[root@host hybrid-wl]# modprobe wl
至此,你的無(wú)線網(wǎng)卡等應(yīng)該亮起了,恭喜你,能登陸互聯(lián)網(wǎng)啦!
前面9、11是手動(dòng)臨時(shí)的解決方案,為了永久生效,需要進(jìn)行相關(guān)自動(dòng)化設(shè)置。
11.設(shè)置系統(tǒng)自動(dòng)卸載模塊
Couple of more steps are needed to get your module load every time the system boots. First, edit the /etc/modprobe.d/blacklist.conf file adding the lines:
在/etc/modprobe.d/blacklist.conf添加如下內(nèi)容,若沒(méi)有此文件就創(chuàng)建。以確保剛剛卸載的系統(tǒng)默認(rèn)模塊在下次不會(huì)啟動(dòng)
blacklist bcm43xx blacklist b43 blacklist b43legacy blacklist bcma blacklist brcmsmac blacklist ssb blacklist ndiswrapper
12.設(shè)置系統(tǒng)自動(dòng)加載模塊
By doing so, you're preventing these modules from being loaded into kernel at boot time and conflicting with the wl module. Second, in order to load the wl module into the kernel on boot time, create/edit the file /etc/sysconfig/modules/kmod-wl.modules and copy-paste the following contents into it:
創(chuàng)建/etc/sysconfig/modules/kmod-wl.modules模塊使系統(tǒng)默認(rèn)加載
#!/bin/bash
for M in lib80211 cfg80211 wl; do
modprobe $M &>/dev/null
done
至此,可以踏實(shí)用的無(wú)線了。
以上內(nèi)容摘自
參考鏈接:https://www.cnblogs.com/liangliu/p/6237487.html 在centos7(EL7.3 即 kernel-3.10.0-514.X )上安裝BCM4312無(wú)線網(wǎng)卡驅(qū)動(dòng)要注意的問(wèn)題
官方鏈接:https://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom?action=show Broadcom Corporation BCM4311, BCM4312, BCM4313, BCM4321, BCM4322, BCM43224, BCM43225, BCM43227 and BCM43228 Based Wireless NICs
以上有不到之處盡請(qǐng)諒解,若有侵權(quán)行為,及時(shí)更正。
總結(jié)
以上是生活随笔為你收集整理的centos7.7上安装broadcom bcm4312无线网卡驱动的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 发送JSON数据给服务器
- 下一篇: iOS手势操作简介(一)