Linux centos7操作系统 VMware虚拟机安装水星免驱USB网卡8188gu记录_centos 安装无线8188gu
最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!
**看看Linux的版本信息:**
[root@centos10 media]# uname -a
Linux centos10 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@centos10 ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
**进一步看看USB的信息(lsusb命令如果没有,需要安装,安装命令为 yun install usbutils -y):**
[root@centos10 ~]# lsusb
Bus 001 Device 002: ID 0bda:1a2b Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc.
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[root@centos10 ~]# lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M
|__ Port 1: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 1: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
**第一个命令lsusb输出的第一个就是网卡了,第二个命令lsusb -tv可以印证,因为是usb-storage嘛,480M表示是usb3.0协议,读写速度,这些不需要过多关心**
**主要需要关注的是****ID 0bda:1a2b, 利用此ID ,进一步识别网卡信息(注意,usb\_modeswitch命令最小化安装没有,需要安装,yum install usb\_modeswitch -y):**
[root@centos10 ~]# usb_modeswitch -KW -v 0bda -p 1a2b
Take all parameters from the command line
- usb_modeswitch: handle USB devices with multiple modes
- Version 2.5.1 © Josua Dietze 2017
- Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x0bda
DefaultProduct= 0x1a2b
StandardEject=1
Look for default devices …
found USB ID 0bda:1a2b
vendor ID matched
product ID matched
found USB ID 1d6b:0002
found USB ID 0e0f:0008
found USB ID 0e0f:0002
found USB ID 0e0f:0003
found USB ID 1d6b:0001
Found devices in default mode (1)
Access device 002 on bus 001
Get the current device configuration …
Current configuration number is 1
Use interface number 0
with class 8
Use endpoints 0x0b (out) and 0x8a (in)
USB description data (for identification)
Manufacturer: Realtek
Product: DISK
Serial No.: not provided
Sending standard EJECT sequence
Looking for active drivers …
OK, driver detached
Set up interface 0
Use endpoint 0x0b for message sending …
Trying to send message 1 to endpoint 0x0b …
OK, message successfully sent
Read the response to message 1 (CSW) …
Response successfully read (13 bytes), status 1
Trying to send message 2 to endpoint 0x0b …
OK, message successfully sent
Read the response to message 2 (CSW) …
Response reading failed (error -8)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
[root@centos10 ~]# lsusb
Bus 001 Device 003: ID 0bda:b711 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc.
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
**再次查看USB信息,可以看到ID改变了,变为****0bda:b711 ,****说明Linux正确识别到了,但是,此时还没有驱动来驱动该硬件**
**在Linux下查询网卡芯片信息比较困难,其实比较简单的办法是在Windows下查看,见下图:**
![](https://img-blog.csdnimg.cn/direct/aaa23e5efd584e1e9b5bc536052323c3.png)
**补充:**
**如何确定网卡的芯片型号是重中之重,关系到后面的网卡是否能正确识别使用,因此,我补充一下,如何查询网卡芯片型号的问题**
**芯片对应 列表在这个网站**[http://www.linux-usb.org/usb.ids]( )**,可以查询到两个b711,第二个说的是在切换后,因此确定是8188gu了**
b711 EW-7722UAC 802.11a/b/g/n/ac (2x2) Wireless Adapter [MediaTek MT7612U]
b711 RTL8188GU 802.11n WLAN Adapter (After Modeswitch)
**我们可以确定该网卡的芯片是8188gu的,在网上寻找此芯片的Linux版本驱动就可以了,本次实验使用的是版本是下面的链接(第一个没有dkms.conf 第二个有dkms.conf ,第二个更加好用一些,如果会dkms的话):**
[https://github.com/McMCCRU/rtl8188gu]( )
**我想这个应该也是可以的:**
[GitHub - wandercn/RTL8188GU: Realtek RTL8188GU Driver for TP-link TL-WN725N USB wifi]( )
### **三,**
### **相关资料介绍和驱动安装**
**驱动和操作系统的内核是密切相关的,因此, 本例中,需要升级内核,据测试,3.10版本的内核不会成功,本例中使用的内核版本是5版本**
**其次,是我们下载的驱动都是c语言的,因此,gcc的版本也需要比较高,默认的gcc4.8版本经测试也是失败的,本例中使用的gcc是9版本**
**本例涉及使用的安装包在下面的链接:**
**链接:https://pan.baidu.com/s/1tQseIUjo\_MVCe-kaU8cROA?pwd=kkey
提取码:kkey**
![](https://img-blog.csdnimg.cn/direct/2f00a91e5a2742cbabff648c01393d8c.png)
1,
**升级内核**
**进入目录**
[root@centos10 kernel-lt-5.4.266]# pwd
/root/11/kernel-lt-5.4.266
[root@centos10 kernel-lt-5.4.266]# ll
total 75756
-rw-r–r-- 1 root root 52929208 Jan 15 06:21 kernel-lt-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 13541288 Jan 15 06:21 kernel-lt-devel-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 8626820 Jan 15 06:21 kernel-lt-doc-5.4.266-1.el7.elrepo.noarch.rpm
-rw-r–r-- 1 root root 1401376 Jan 15 06:21 kernel-lt-headers-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 233736 Jan 15 06:21 kernel-lt-tools-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 120376 Jan 15 06:21 kernel-lt-tools-libs-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 97832 Jan 15 06:21 kernel-lt-tools-libs-devel-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 603824 Jan 15 06:21 python-perf-5.4.266-1.el7.elrepo.x86_64.rpm
**可以强制安装,这个没有什么影响:**
[root@centos10 kernel-lt-5.4.266]# rpm -ivh ./* --force --nodeps
warning: ./kernel-lt-5.4.266-1.el7.elrepo.x86_64.rpm: Header V4 DSA/SHA256 Signature, key ID baadae52: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:kernel-lt-tools-libs-5.4.266-1.el################################# [ 13%]
2:kernel-lt-tools-5.4.266-1.el7.elr################################# [ 25%]
3:kernel-lt-tools-libs-devel-5.4.26################################# [ 38%]
4:python-perf-5.4.266-1.el7.elrepo ################################# [ 50%]
5:kernel-lt-headers-5.4.266-1.el7.e################################# [ 63%]
6:kernel-lt-doc-5.4.266-1.el7.elrep################################# [ 75%]
7:kernel-lt-devel-5.4.266-1.el7.elr################################# [ 88%]
8:kernel-lt-5.4.266-1.el7.elrepo ################################# [100%]
**安装完毕后,重启虚拟机,选择新内核,进入系统,再次激活USB:**
[root@centos10 ~]# usb_modeswitch -KW -v 0bda -p 1a2b
Take all parameters from the command line
- usb_modeswitch: handle USB devices with multiple modes
- Version 2.5.1 © Josua Dietze 2017
- Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x0bda
DefaultProduct= 0x1a2b
StandardEject=1
Look for default devices …
found USB ID 0bda:1a2b
vendor ID matched
product ID matched
found USB ID 1d6b:0002
found USB ID 0e0f:0008
found USB ID 0e0f:0002
found USB ID 0e0f:0003
found USB ID 1d6b:0001
Found devices in default mode (1)
Access device 002 on bus 001
Get the current device configuration …
Current configuration number is 1
Use interface number 0
with class 8
Use endpoints 0x0b (out) and 0x8a (in)
USB description data (for identification)
Manufacturer: Realtek
Product: DISK
Serial No.: not provided
Sending standard EJECT sequence
Looking for active drivers …
OK, driver detached
Set up interface 0
Use endpoint 0x0b for message sending …
Trying to send message 1 to endpoint 0x0b …
OK, message successfully sent
Read the response to message 1 (CSW) …
Response successfully read (13 bytes), status 1
Trying to send message 2 to endpoint 0x0b …
OK, message successfully sent
Read the response to message 2 (CSW) …
Response reading failed (error -8)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
**2,**
**安装gcc9:**
[root@centos10 11]# tar xvf gcc-9.tar
[root@centos10 11]# mkdir /opt/rh
[root@centos10 11]# mv devtoolset-9/ /opt/rh/
[root@centos10 11]# source /opt/rh/devtoolset-9/enable
[root@centos10 11]# echo “source /opt/rh/devtoolset-9/enable” >>/etc/profile
[root@centos10 11]# source /etc/profile
**验证gcc是否安装成功:**
[root@centos10 11]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
Target: x86_64-redhat-linux
Configured with: …/configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.3.1-20200408/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)
**3,**
**编译的环境依赖安装:**
**因为我前面编译过,因此,清除了上次的编译,主要是安装bc 和gcc-c++**
[root@centos10 rtl8188gu-master]# yum install unzip gcc-c++ bc -y
[root@centos10 rtl8188gu-master]# make clean
#make -C /lib/modules/5.4.266-1.el7.elrepo.x86_64/build M=/root/11/rtl8188gu-master clean
cd hal ; rm -fr ///.mod.c ///.mod ///.o ///.o.* ///..cmd ///.ko
cd hal ; rm -fr //.mod.c //.mod //.o //.o.* //..cmd //.ko
cd hal ; rm -fr /.mod.c /.mod /.o /.o.* /..cmd /.ko
cd hal ; rm -fr *.mod.c *.mod .o .o. ..cmd *.ko
cd core/efuse ; rm -fr *.mod.c *.mod .o .o. ..cmd *.ko
cd core ; rm -fr *.mod.c *.mod .o .o. ..cmd *.ko
cd os_dep/linux ; rm -fr *.mod.c *.mod .o .o. ..cmd *.ko
cd os_dep ; rm -fr *.mod.c *.mod .o .o. ..cmd *.ko
cd platform ; rm -fr *.mod.c *.mod .o .o. ..cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod .o .o. ..cmd *.ko *~
rm -fr .tmp_versions
rm -fr .cache.mk
**4,**
**开始编译:**
**预编译,完成后 echo $? 看看是不是正常完成:**
[root@centos10 rtl8188gu-master]# make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.4.266-1.el7.elrepo.x86_64/build M=/root/11/rtl8188gu-master modules
make[1]: Entering directory /usr/src/kernels/5.4.266-1.el7.elrepo.x86_64' CC [M] /root/11/rtl8188gu-master/core/rtw_cmd.o CC [M] /root/11/rtl8188gu-master/core/rtw_security.o CC [M] /root/11/rtl8188gu-master/core/rtw_debug.o CC [M] /root/11/rtl8188gu-master/core/rtw_io.o CC [M] /root/11/rtl8188gu-master/core/rtw_ioctl_query.o CC [M] /root/11/rtl8188gu-master/core/rtw_ioctl_set.o CC [M] /root/11/rtl8188gu-master/core/rtw_ieee80211.o CC [M] /root/11/rtl8188gu-master/core/rtw_mlme.o CC [M] /root/11/rtl8188gu-master/core/rtw_mlme_ext.o CC [M] /root/11/rtl8188gu-master/core/rtw_mi.o CC [M] /root/11/rtl8188gu-master/core/rtw_wlan_util.o CC [M] /root/11/rtl8188gu-master/core/rtw_vht.o CC [M] /root/11/rtl8188gu-master/core/rtw_pwrctrl.o CC [M] /root/11/rtl8188gu-master/core/rtw_rf.o CC [M] /root/11/rtl8188gu-master/core/rtw_recv.o CC [M] /root/11/rtl8188gu-master/core/rtw_sta_mgt.o CC [M] /root/11/rtl8188gu-master/core/rtw_ap.o CC [M] /root/11/rtl8188gu-master/core/rtw_xmit.o CC [M] /root/11/rtl8188gu-master/core/rtw_p2p.o CC [M] /root/11/rtl8188gu-master/core/rtw_rson.o CC [M] /root/11/rtl8188gu-master/core/rtw_tdls.o CC [M] /root/11/rtl8188gu-master/core/rtw_br_ext.o CC [M] /root/11/rtl8188gu-master/core/rtw_iol.o CC [M] /root/11/rtl8188gu-master/core/rtw_sreset.o CC [M] /root/11/rtl8188gu-master/core/rtw_btcoex_wifionly.o CC [M] /root/11/rtl8188gu-master/core/rtw_btcoex.o CC [M] /root/11/rtl8188gu-master/core/rtw_beamforming.o CC [M] /root/11/rtl8188gu-master/core/rtw_odm.o CC [M] /root/11/rtl8188gu-master/core/efuse/rtw_efuse.o CC [M] /root/11/rtl8188gu-master/os_dep/osdep_service.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/os_intfs.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/usb_intf.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/usb_ops_linux.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/ioctl_linux.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/xmit_linux.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/mlme_linux.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/recv_linux.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/ioctl_cfg80211.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/rtw_cfgvendor.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/wifi_regd.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/rtw_android.o CC [M] /root/11/rtl8188gu-master/os_dep/linux/rtw_proc.o CC [M] /root/11/rtl8188gu-master/hal/hal_intf.o CC [M] /root/11/rtl8188gu-master/hal/hal_com.o CC [M] /root/11/rtl8188gu-master/hal/hal_com_phycfg.o CC [M] /root/11/rtl8188gu-master/hal/hal_phy.o CC [M] /root/11/rtl8188gu-master/hal/hal_dm.o CC [M] /root/11/rtl8188gu-master/hal/hal_dm_acs.o CC [M] /root/11/rtl8188gu-master/hal/hal_btcoex_wifionly.o CC [M] /root/11/rtl8188gu-master/hal/hal_btcoex.o CC [M] /root/11/rtl8188gu-master/hal/hal_mp.o CC [M] /root/11/rtl8188gu-master/hal/hal_mcc.o CC [M] /root/11/rtl8188gu-master/hal/hal_hci/hal_usb.o CC [M] /root/11/rtl8188gu-master/hal/led/hal_usb_led.o CC [M] /root/11/rtl8188gu-master/hal/HalPwrSeqCmd.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/Hal8710BPwrSeq.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_sreset.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_hal_init.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_phycfg.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_rf6052.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_dm.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_rxdesc.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_cmd.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/hal8710b_fw.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/rtl8710b_lps_poff.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/usb/usb_halinit.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/usb/rtl8710bu_led.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/usb/rtl8710bu_xmit.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/usb/rtl8710bu_recv.o CC [M] /root/11/rtl8188gu-master/hal/rtl8710b/usb/usb_ops.o CC [M] /root/11/rtl8188gu-master/hal/efuse/rtl8710b/HalEfuseMask8710B_USB.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_debug.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_antdiv.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_soml.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_smt_ant.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_antdect.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_interface.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_phystatus.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_hwconfig.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_dig.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_pathdiv.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_rainfo.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_dynamictxpower.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_adaptivity.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_cfotracking.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_noisemonitor.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_acs.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_beamforming.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_dfs.o CC [M] /root/11/rtl8188gu-master/hal/phydm/txbf/halcomtxbf.o CC [M] /root/11/rtl8188gu-master/hal/phydm/txbf/haltxbfinterface.o CC [M] /root/11/rtl8188gu-master/hal/phydm/txbf/phydm_hal_txbf_api.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_adc_sampling.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_ccx.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_psd.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_primary_cca.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_cck_pd.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_rssi_monitor.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_auto_dbg.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_math_lib.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_api.o CC [M] /root/11/rtl8188gu-master/hal/phydm/phydm_pow_train.o CC [M] /root/11/rtl8188gu-master/hal/phydm/halrf/halrf.o CC [M] /root/11/rtl8188gu-master/hal/phydm/halrf/halphyrf_ce.o CC [M] /root/11/rtl8188gu-master/hal/phydm/halrf/halrf_powertracking_ce.o CC [M] /root/11/rtl8188gu-master/hal/phydm/halrf/halrf_powertracking.o CC [M] /root/11/rtl8188gu-master/hal/phydm/halrf/halrf_kfree.o CC [M] /root/11/rtl8188gu-master/hal/phydm/rtl8710b/halhwimg8710b_bb.o CC [M] /root/11/rtl8188gu-master/hal/phydm/rtl8710b/halhwimg8710b_mac.o CC [M] /root/11/rtl8188gu-master/hal/phydm/rtl8710b/halhwimg8710b_rf.o CC [M] /root/11/rtl8188gu-master/hal/phydm/rtl8710b/phydm_regconfig8710b.o CC [M] /root/11/rtl8188gu-master/hal/phydm/rtl8710b/phydm_rtl8710b.o CC [M] /root/11/rtl8188gu-master/hal/phydm/halrf/rtl8710b/halrf_8710b.o CC [M] /root/11/rtl8188gu-master/hal/btc/halbtc8723bwifionly.o CC [M] /root/11/rtl8188gu-master/hal/btc/halbtc8822bwifionly.o CC [M] /root/11/rtl8188gu-master/hal/btc/halbtc8821cwifionly.o CC [M] /root/11/rtl8188gu-master/platform/platform_ops.o LD [M] /root/11/rtl8188gu-master/8188gu.o Building modules, stage 2. MODPOST 1 modules CC [M] /root/11/rtl8188gu-master/8188gu.mod.o LD [M] /root/11/rtl8188gu-master/8188gu.ko make[1]: Leaving directory
/usr/src/kernels/5.4.266-1.el7.elrepo.x86_64’
[root@centos10 rtl8188gu-master]# echo $?
0
**开始驱动安装:**
[root@centos10 rtl8188gu-master]# make install
install -p -m 644 8188gu.ko /lib/modules/5.4.266-1.el7.elrepo.x86_64/kernel/drivers/net/wireless/
/sbin/depmod -a 5.4.266-1.el7.elrepo.x86_64
**可以看到,驱动是安装到了/lib/modules/5.4.266-1.el7.elrepo.x86\_64/kernel/drivers/net/wireless/这个目录下,并且最后depmod 了一下**
### **三,**
### **检查驱动安装和使用驱动**
**网卡驱动安装基本上算是完成了,现在需要彻底激活此网卡**
**查看网卡的驱动模块是否正确加载:**
**没有任何输出,如果正确加载会有输出的哦**
[root@centos10 rtl8188gu-master]# lsmod |grep 8188
**这个时候不要慌,看看该网卡驱动的详细信息:**
[root@centos10 rtl8188gu-master]# modinfo /lib/modules/5.4.266-1.el7.elrepo.x86_64/kernel/drivers/net/wireless/8188gu.ko
filename: /lib/modules/5.4.266-1.el7.elrepo.x86_64/kernel/drivers/net/wireless/8188gu.ko
version: v5.2.20.2_28373.20180619
author: Realtek Semiconductor Corp.
description: Realtek Wireless Lan Driver
license: GPL
srcversion: 50084205D88612258B5BBBB
alias: usb:v0BDAp2005ddcdscdpicFFiscFFipFFin*
alias: usb:v0BDApB711ddcdscdpicFFiscFFipFFin*
depends: cfg80211
retpoline: Y
name: 8188gu
vermagic: 5.4.266-1.el7.elrepo.x86_64 SMP mod_unload modversions
parm: rtw_ips_mode:The default IPS mode (int)
parm: rtw_lps_level:The default LPS level (int)
parm: rtw_usb_rxagg_mode:int
parm: rtw_dynamic_agg_enable:int
parm: rtw_drv_log_level:set log level when insert driver module, default log level is DRV_INFO = 4 (uint)
parm: rtw_tx_bw_mode:The max tx bw for 2.4G and 5G. format is the same as rtw_bw_mode (uint)
parm: rtw_rx_ampdu_sz_limit_1ss:RX AMPDU size limit for 1SS link of each BW, 0xFF: no limitation (array of uint)
parm: rtw_rx_ampdu_sz_limit_2ss:RX AMPDU size limit for 2SS link of each BW, 0xFF: no limitation (array of uint)
parm: rtw_rx_ampdu_sz_limit_3ss:RX AMPDU size limit for 3SS link of each BW, 0xFF: no limitation (array of uint)
parm: rtw_rx_ampdu_sz_limit_4ss:RX AMPDU size limit for 4SS link of each BW, 0xFF: no limitation (array of uint)
parm: rtw_vht_enable:int
parm: rtw_vht_rx_mcs_map:VHT RX MCS map (uint)
parm: rtw_rf_config:int
parm: rtw_country_code:The default country code (in alpha2) (charp)
parm: rtw_channel_plan:The default chplan ID when rtw_alpha2 is not specified or valid (int)
parm: rtw_excl_chs:exclusive channel array (array of uint)
parm: rtw_qos_opt_enable:int
parm: ifname:The default name to allocate for first interface (charp)
parm: if2name:The default name to allocate for second interface (charp)
parm: rtw_pwrtrim_enable:int
parm: rtw_initmac:charp
parm: rtw_special_rf_path:int
parm: rtw_chip_version:int
parm: rtw_rfintfs:int
parm: rtw_lbkmode:int
parm: rtw_network_mode:int
parm: rtw_channel:int
parm: rtw_mp_mode:int
parm: rtw_wmm_enable:int
parm: rtw_vrtl_carrier_sense:int
parm: rtw_vcs_type:int
parm: rtw_busy_thresh:int
parm: rtw_ht_enable:int
parm: rtw_bw_mode:int
parm: rtw_ampdu_enable:int
parm: rtw_rx_stbc:int
parm: rtw_rx_ampdu_amsdu:int
parm: rtw_tx_ampdu_amsdu:int
parm: rtw_beamform_cap:int
parm: rtw_lowrate_two_xmit:int
parm: rtw_power_mgnt:int
parm: rtw_smart_ps:int
parm: rtw_low_power:int
parm: rtw_wifi_spec:int
parm: rtw_full_ch_in_p2p_handshake:int
parm: rtw_antdiv_cfg:int
parm: rtw_antdiv_type:int
parm: rtw_drv_ant_band_switch:int
parm: rtw_single_ant_path:int
parm: rtw_switch_usb_mode:int
parm: rtw_enusbss:int
parm: rtw_hwpdn_mode:int
parm: rtw_hwpwrp_detect:int
parm: rtw_hw_wps_pbc:int
parm: rtw_check_hw_status:int
parm: rtw_max_roaming_times:The max roaming times to try (uint)
parm: rtw_mc2u_disable:int
parm: rtw_80211d:Enable 802.11d mechanism (int)
parm: rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm: rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)
parm: rtw_adaptivity_en:0:disable, 1:enable (uint)
parm: rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)
parm: rtw_adaptivity_dml:0:disable, 1:enable (uint)
parm: rtw_adaptivity_dc_backoff:DC backoff for Adaptivity (uint)
parm: rtw_adaptivity_th_l2h_ini:th_l2h_ini for Adaptivity (int)
parm: rtw_adaptivity_th_edcca_hl_diff:th_edcca_hl_diff for Adaptivity (int)
parm: rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)
parm: rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)
parm: rtw_RFE_type:default init value:64 (uint)
parm: rtw_powertracking_type:default init value:64 (uint)
parm: rtw_GLNA_type:default init value:0 (uint)
parm: rtw_TxBBSwing_2G:default init value:0xFF (uint)
parm: rtw_TxBBSwing_5G:default init value:0xFF (uint)
parm: rtw_OffEfuseMask:default open Efuse Mask value:0 (uint)
parm: rtw_FileMaskEfuse:default drv Mask Efuse value:0 (uint)
parm: rtw_rxgain_offset_2g:default RF Gain 2G Offset value:0 (uint)
parm: rtw_rxgain_offset_5gl:default RF Gain 5GL Offset value:0 (uint)
parm: rtw_rxgain_offset_5gh:uint
parm: rtw_rxgain_offset_5gm:default RF Gain 5GM Offset value:0 (uint)
parm: rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)
parm: rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm: rtw_target_tx_pwr_2g_a:2.4G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm: rtw_target_tx_pwr_2g_b:2.4G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm: rtw_target_tx_pwr_2g_c:2.4G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm: rtw_target_tx_pwr_2g_d:2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm: rtw_phy_file_path:The path of phy parameter (charp)
parm: rtw_load_phy_file:PHY File Bit Map (int)
parm: rtw_decrypt_phy_file:Enable Decrypt PHY File (int)
parm: rtw_en_napi:int
parm: rtw_en_gro:int
parm: rtw_iqk_fw_offload:int
**可以看到该网卡驱动依赖的是另一个模块cfg80211,lsmod命令没有看到cfg80211,modinfo看不到该模块的信息(备注:该模块是kernel的验证签名模块)**
[root@centos10 rtl8188gu-master]# find / -name cfg80211
/usr/src/kernels/5.4.266-1.el7.elrepo.x86_64/include/config/cfg80211
[root@centos10 rtl8188gu-master]# modinfo /usr/src/kernels/5.4.266-1.el7.elrepo.x86_64/include/config/cfg80211
modinfo: ERROR: Module /usr/src/kernels/5.4.266-1.el7.elrepo.x86_64/include/config/cfg80211 not found.
**查看系统日志,可以看到网卡的USB无法使用:**
[ 11.810876] Buffer I/O error on dev sr1, logical block 32640, async page read
[ 11.981365] sr 32:0:0:0: [sr1] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 11.981369] sr 32:0:0:0: [sr1] tag#0 CDB: Read(10) 28 00 00 00 ff 00 00 00 3c 00
[ 11.981371] blk_update_request: I/O error, dev sr1, sector 261120 op 0x0:(READ) flags 0x84700 phys_seg 30 prio class 0
[ 12.083530] sr 32:0:0:0: [sr1] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 12.083535] sr 32:0:0:0: [sr1] tag#0 CDB: Read(10) 28 00 00 00 ff 3c 00 00 04 00
[ 12.083537] blk_update_request: I/O error, dev sr1, sector 261360 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 0
[ 12.116606] sr 32:0:0:0: [sr1] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 12.116629] sr 32:0:0:0: [sr1] tag#0 CDB: Read(10) 28 00 00 00 ff 00 00 00 02 00
[ 12.116633] blk_update_request: I/O error, dev sr1, sector 261120 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 12.116725] Buffer I/O error on dev sr1, logical block 32640, async page read
[ 35.543061] usb 1-1: USB disconnect, device number 2
**使用modprobe命令重新激活这两个模块(没有输出表示正确哦),并查看模块是否正确加载:**
[root@centos10 rtl8188gu-master]# modprobe cfg80211
[root@centos10 rtl8188gu-master]# modprobe 8188gu
[root@centos10 rtl8188gu-master]# lsmod |grep 8188 ||grep cfg80211
8188gu 1007616 0
cfg80211 704512 1 8188gu
**这个时候,可以看到cfg80211的模块信息了(上面的说看不到信息的话,我收回!!!!!,这里表明此模块是无线连接的支持模块,收回此模块是签名验证的说法!!!!!):**
[root@centos10 rtl8188gu-master]# find / -name cfg80211.ko
/usr/lib/modules/5.4.266-1.el7.elrepo.x86_64/kernel/net/wireless/cfg80211.ko
[root@centos10 rtl8188gu-master]# modinfo /usr/lib/modules/5.4.266-1.el7.elrepo.x86_64/kernel/net/wireless/cfg80211.ko
filename: /usr/lib/modules/5.4.266-1.el7.elrepo.x86_64/kernel/net/wireless/cfg80211.ko
alias: net-pf-16-proto-16-family-nl80211
description: wireless configuration support
license: GPL
author: Johannes Berg
srcversion: 6CA837C31154DE1B46FBEC0
depends: rfkill
retpoline: Y
intree: Y
name: cfg80211
vermagic: 5.4.266-1.el7.elrepo.x86_64 SMP mod_unload modversions
parm: bss_entries_limit:limit to number of scan BSS entries (per wiphy, default 1000) (int)
parm: ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)
parm: cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)
**此时并没有看到这个新安装的网卡:**
[root@centos10 rtl8188gu-master]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.123.20 netmask 255.255.255.0 broadcast 192.168.123.255
inet6 fd15:4ba5:5a2b:1008:162e:7500:4e67:2fb1 prefixlen 64 scopeid 0x0
inet6 fe80::523b:7d77:34e9:fa42 prefixlen 64 scopeid 0x20
ether 00:0c:29:e8:89:a2 txqueuelen 1000 (Ethernet)
RX packets 2903 bytes 217349 (212.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2910 bytes 629873 (615.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 19 base 0x2000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
**可以看到,ens33这个网卡有异常,好像多了ipv6的信息,应该是一个ipv6的,查看系统日志,看到如下报错:**
[1705156203.3089] device (ens33): ipv6: duplicate address check faile
**因此,决定关闭ipv6,关闭步骤如下:**
**1,**
**删除ens33网卡内的所有关于ipv6的信息,最终该网卡的配置文件如下:**
[root@centos10 rtl8188gu-master]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens33
UUID=abed039b-c453-47ee-acd4-301974b75aab
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.123.20
GATEWAY=192.168.123.2
NETMASK=255.255.225.0
DNS1=223.5.5.5
DNS1=223.6.6.6
**2,**
**内核屏蔽ipv6:**
[root@centos10 rtl8188gu-master]# cat /etc/sysctl.conf
sysctl settings are defined through files in
/usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
Vendors settings live in /usr/lib/sysctl.d/.
To override a whole file, create a new file with the same in
/etc/sysctl.d/ and put new settings there. To override
only specific settings, add a file with a lexically later
name in /etc/sysctl.d/ and put new settings there.
For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
**最后两行屏蔽ipv6的,然后sysctl -p 激活此设置**
**3,**
**network这个文件末尾添加no**
[root@centos10 rtl8188gu-master]# cat /etc/sysconfig/network
Created by anaconda
NETWORKING_IPV6=no
**4,**
**重启网络**
[root@centos10 rtl8188gu-master]# systemctl restart NetworkManager
[root@centos10 rtl8188gu-master]# systemctl restart network
**5,**
**重新插拔网卡,再次查看网卡信息,新网卡出来了:**
[root@centos10 rtl8188gu-master]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 00:0c:29:e8:89:a2 brd ff:ff:ff:ff:ff:ff
inet 192.168.123.20/24 brd 192.168.123.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
最后的话
最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!
资料预览
给大家整理的视频资料:
给大家整理的电子书资料:
如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 00:0c:29:e8:89:a2 brd ff:ff:ff:ff:ff:ff
inet 192.168.123.20/24 brd 192.168.123.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
最后的话
最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!
资料预览
给大家整理的视频资料:
[外链图片转存中…(img-yPeZNHyH-1714254669051)]
给大家整理的电子书资料:
[外链图片转存中…(img-ccXT0ZJU-1714254669052)]
如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
更多推荐
所有评论(0)