Install broadcom bcm4312 wireless card driver on CentOS 7.7

broadcom bcm4312 is an old wireless network card, which can't be driven by default on centos 7.7. The installation needs to be compiled manually. According to centos's official statement, many network cards need to recompile the driver before they can run normally. Include:

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

In the process of installation, I refer to the articles of several big gods (the article link is attached) and encounter various problems during the implementation of make, that is, the implementation can not continue. There are two points to sum up: first, the articles of big gods are not reviewed in detail; second, the official patch updates and steps are also updated; third, based on the error reporting selection scheme.

The following process is a combination of several great God articles and official documents, which can be written down for the reference of later fellow believers.

1. Identify the model of network card

Execute lspci | grep '802'

Official:

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

2. Confirm whether the kernel headers kernel devel GCC has been installed

RPM - QA kernel headers kernel devel GCC or Yum list kernel headers kernel devel GCC

Kernel headers kernel devel GCC is generally installed when the full version of the operating system is installed. If the operating system image is not mounted, it can be installed directly.

3. Download broadcom driver

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

Note that to match the operating system version, the author chooses Linux sta 64 bit driver

 

4. Unzip the file

Official:

[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

In the compilation process, the related files called by the kernel will be generated, which will also be in the directory you decompress. Therefore, the decompressed files should be placed in the location that can be accessed for a long time. The author will follow the official documents, in which someuser is replaced by the shared user of the system. The author refers to the document of the God, and uses the nobody

5. Compile files

Official

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

Here's the key. Attention

Just use make directly here. The official installation package has integrated these contents.

Most of the mistakes will be made here. The author is stuck here.

The correct steps are:

1) Install the official patch first. See Step 6 for details

2) Perform sed modification again. See Step 7 for details

3) Finally, make, step 5

6. Install the official patch pack

Download the official patch package

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:

Install patch pack

[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. Install the official patch pack

Execute the sed command as follows

[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. Perform make compilation

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

The above process must not be skipped, and the order cannot be wrong.

At this point, the compilation is complete. Next, start module loading, system module configuration, and automatic startup.

8. Uninstall the relevant modules installed by default in the system to avoid conflicts.

[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

During the execution of the above steps, you may be prompted that no driver module is found. Just execute it directly.

8. Load the installed driver module 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/

It will be found here that the command here actually links the modules generated through make to the modules in the directory just after decompression. This also explains why it should be placed in a location that can be accessed for a long time.

9. Dependence of automatic detection module

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

The Linux depmod command is used to analyze the dependencies of loadable modules.

10. Loading module

[root@host hybrid-wl]# modprobe wl

So far, your wireless network card should be on. Congratulations, you can log on to the Internet!

 

The previous 9 and 11 are manual and temporary solutions. In order to take effect permanently, relevant automatic settings are required.

11. Set the system automatic unloading module

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:

Add the following to / etc/modprobe.d/blacklist.conf, and create it without this file. To ensure that the system default module just uninstalled will not start next time

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

12. Set the system automatic loading module

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:

Create / etc/sysconfig/modules/kmod-wl.modules module to load the system by default

#!/bin/bash

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

 

At this point, you can step on the practical wireless.

 

Excerpt from above

Reference: https://www.cnblogs.com/liangliu/p/6237487.html Some problems in installing BCM4312 wireless network card driver on centos7 (EL7.3, namely kernel-3.10.0-514.X)

Official link: 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

 

In case of any infringement, please correct it in time.

Tags: Linux network CentOS RPM

Posted on Fri, 13 Mar 2020 03:20:35 -0400 by RavenStar