centos7.7上安裝broadcom bcm4312無線網卡驅動

来源:https://www.cnblogs.com/worter991/archive/2020/03/13/12387598.html
-Advertisement-
Play Games

broadcom bcm4312為比較老的無線網卡了,在centos7.7上預設是驅動不起來的。需要手動編譯安裝。按照centos官方的說法很多網卡都需要重新編譯驅動後才能正常運行。包括: Broadcom Corporation BCM4311, BCM4312, BCM4313, BCM4321 ...


broadcom bcm4312為比較老的無線網卡了,在centos7.7上預設是驅動不起來的。需要手動編譯安裝。按照centos官方的說法很多網卡都需要重新編譯驅動後才能正常運行。包括:

Broadcom Corporation BCM4311, BCM4312, BCM4313, BCM4321, BCM4322, BCM43224, BCM43225, BCM43227 and BCM43228 Based Wireless NICs

在安裝過程中參考了幾位大神的文章(文章鏈接附後)在執行make過程遇到各種個這樣的問題,就是執行不下去,總結起來有兩點:一是大神門的文章沒有細看,二是,官方補丁更新、步驟也有所更新,三是,基於針對報錯選擇方案。

以下過程結合了幾位大神文章和官方文檔,寫下來供後來的同道中人參考。

1.識別網卡的型號

執行lspci | grep '802'

官方:

[user@host ~]$ /sbin/lspci | grep Broadcom
0b:00.0 Network controller: Broadcom Corporation BCM4312 802.11a/b/g (rev 01)

2.確認kernel-headers kernel-devel gcc是否已經安裝

rpm -qa kernel-headers kernel-devel gcc 或 yum list kernel-headers kernel-devel gcc

kernel-headers kernel-devel gcc一般在安裝完整版操作系統時都安裝了,若沒有掛載操作系統鏡像直接安裝即可。

3.下載broadcom驅動

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

 註意要與操作系統版本匹配,筆者選擇的是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

在編譯過程中會生成相關被內核調用的文件,也會在你解壓的目錄下,因此解壓的文件要放到可以長久訪問的位置,筆者按照官方文檔進行的,其中someuser替換成系統的共用用戶,筆者參考了大神的文檔,使用的nobody.

5.編譯文件

官方

[user@host hybrid-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`

 關鍵點來了,註意了

此處直接使用make就行,官方安裝包已經集成了這些內容。

此處大部分會出錯,筆者就這這裡卡殼了。

正確的步驟是:

1)先安裝官方補丁,詳見第6步

2)再執行sed修改操作,詳見第7步

3)最後執行make,第5步

6.安裝官方補丁包

下載官方提供補丁包

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:

 安裝補丁包

[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.安裝官方補丁包

執行如下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.執行make編譯

[user@host hybrid-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`

以上過程一定不能跳過,順序不能錯。

至此,編譯完成了。接下來開始模塊載入、系統模塊配置和自動啟動工作。

8.卸載系統中預設安裝的相關模塊,以免出現衝突。

[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

 以上步驟執行過程中可能會提示沒有發現驅動模塊,直接執行就好了。

8.載入安裝好的驅動模塊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/

此處會發現,此處命令實際是將在剛剛解壓後目錄下,通過make生成的模塊鏈接到modules下,這裡也就解釋了為什麼要放著在可長久訪問的位置。

9.自動檢測模塊的依賴性

[root@host ~]# depmod $(uname -r)

Linux depmod命令用於分析可載入模塊的相依性。

10.載入模塊

[root@host hybrid-wl]# modprobe wl

至此,你的無線網卡等應該亮起了,恭喜你,能登陸互聯網啦!

 

前面9、11是手動臨時的解決方案,為了永久生效,需要進行相關自動化設置。

11.設置系統自動卸載模塊

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添加如下內容,若沒有此文件就創建。以確保剛剛卸載的系統預設模塊在下次不會啟動

blacklist bcm43xx
blacklist b43
blacklist b43legacy
blacklist bcma
blacklist brcmsmac
blacklist ssb
blacklist ndiswrapper

12.設置系統自動載入模塊

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:

創建/etc/sysconfig/modules/kmod-wl.modules模塊使系統預設載入

#!/bin/bash

for M in lib80211 cfg80211 wl; do
    modprobe $M &>/dev/null
done

 

至此,可以踏實用的無線了。

 

以上內容摘自

參考鏈接:https://www.cnblogs.com/liangliu/p/6237487.html  在centos7(EL7.3 即 kernel-3.10.0-514.X )上安裝BCM4312無線網卡驅動要註意的問題

官方鏈接: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

 

以上有不到之處盡請諒解,若有侵權行為,及時更正。

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 上司給我講採樣率,我覺得自己有點鑽牛角尖了,想來想去還是不明白。 因為說的是日語,サンプリング周波數,我就想是不是我對這個單詞有什麼誤解,但是查了還是採樣頻率。要哭了。 採樣頻率就是一個周期內的採樣次數。畫正弦波的時候就很迷惑,越想越不明白。 一開始的代碼是這樣的 1 for (double the ...
  • 文件搜索命令findfind命令名稱:find命令所在路徑:/bin/find執行許可權:所有用戶功能描述:文件搜索選項與參數:find [PATH] [option] [action]與時間相關的選項:-atime、-ctime、-mtime、-amin、-cmin與-mmin,前面字母為操作類型,... ...
  • 原文鏈接: "https://xiaoheidiannao.com/articles/Keyboard Only To Chrome.html" "Chrome瀏覽器" 是我覺得最好用的 "瀏覽器" ,不僅僅是因為其擁有強大的插件庫,沒有煩人的彈窗廣告,還因為其提供的 "快捷鍵" 幾乎可以完成 "瀏 ...
  • 1. Linux 0.11的調度函數schedule() 1. 也就是找到了counter最大的進程,然後就跳出去執行switch_to,對應上面的優先順序演算法,而counter本身也是時間片,也作了輪轉調度 2. 現在就緒態的所有進程的時間片都用完了counter=0,右移+本身就是把counter ...
  • 這是Linux基礎流程圖,後續有機會會繼續完善,如果寫得不好的地方還請諒解 ...
  • 安裝COAWST可不容易,照著manual上裝了幾天也沒搞定,後來在YouTube上找到了教程。 網址:https://www.youtube.com/watch?v=_SzRNpL8Ibs&list=PL2qZt8XViuyvVZ0DoSy9v5ZnqZ0g9IhMS&index=1 安裝基於ce ...
  • COAWST據說非常有優勢,受到我導的吹捧。 官網:https://www.usgs.gov/software/coupled-ocean-atmosphere-wave-sediment-transport-coawst-modeling-system manual里有寫獲取方法,通過svn來下載 ...
  • 一 Ingress簡介 1.1 Ingress 通常Service的表現形式為IP:Port,即工作在TCP/IP層。 對於基於HTTP的服務來說,不同的URL地址經常對應到不同的後端服務(RS)或者虛擬伺服器( Virtual Host),這些應用層的轉發機制僅通過Kubernetes的Servi ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...