网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
- 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
3: wls35u1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:5c:c2:ce:dc:24 brd ff:ff:ff:ff:ff:ff
**现在需要连接WiFi了,有很多方法,比如上面资料里提到的wpa\_suppliant\_withoutopenssl-master,或者直接在桌面图形化方式连接**
**本次采用桌面方式,因此,先安装一个桌面:**
yum group install “GNOME Desktop”
**安装完毕后,startx命令进入桌面:**
![](https://img-blog.csdnimg.cn/direct/b6e050dbaf6149d0a406a03893a6fcf3.png)
**此时的网卡还没有激活,因此,激活先,看到网卡里有一个up就可以啦:**
[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
3: wls35u1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:5c:c2:ce:dc:24 brd ff:ff:ff:ff:ff:ff
**扫描WiFi热点:**
[root@centos10 rtl8188gu-master]# nmcli device wifi list
IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY
mywifi Infra 5 270 Mbit/s 54 ▂▄__ WPA2
– Infra 5 270 Mbit/s 54 ▂▄__ WPA2
mywifi-WiFi5 Infra 5 270 Mbit/s 52 ▂▄__ WPA2
ChinaNet-gTUm Infra 5 130 Mbit/s 45 ▂▄__ WPA1 WPA2
ChinaNet-6b4R Infra 2 130 Mbit/s 30 ▂___ WPA1
YBJ Infra 1 130 Mbit/s 29 ▂___ WPA1 WPA2
@PHICOMM_40 Infra 2 270 Mbit/s 29 ▂___ WPA1 WPA2
MIQI Infra 11 195 Mbit/s 29 ▂___ WPA1 WPA2
– Infra 11 195 Mbit/s 27 ▂___ WPA1 WPA2
ChinaNet-wfJ9 Infra 10 130 Mbit/s 25 ▂___ WPA1 WPA2
ChinaNet-B9QD Infra 6 130 Mbit/s 24 ▂___ WPA1 WPA2
midea_db_0821 Infra 3 65 Mbit/s 22 ▂___ WPA2
qiangweiguo_Wi-Fi5 Infra 9 130 Mbit/s 22 ▂___ WPA1 WPA2
– Infra 6 540 Mbit/s 20 ▂___ WPA1 WPA2
– Infra 8 130 Mbit/s 20 ▂___ WPA2
qiangweiguo Infra 9 130 Mbit/s 20 ▂___ WPA1 WPA2
– Infra 9 130 Mbit/s 19 ▂___ WPA2
**或者使用iwlist命令(这个命令以后再说,现在只是演示一下):**
[root@centos10 wireless_tools]# iwlist wls35u1 scan
wls35u1 Scan completed :
Cell 01 - Address: 74:05:A5:DC:86:C2
ESSID:“YBJ”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.412 GHz (Channel 1)
Encryption key:on
Bit Rates:144 Mb/s
Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Extra:
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Quality=0/100 Signal level=17/100
Extra:fm=0003
Cell 02 - Address: 50:33:F0:A4:02:3E
ESSID:“801”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.412 GHz (Channel 1)
Encryption key:on
Bit Rates:780 Mb/s
Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Extra:
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Quality=0/100 Signal level=13/100
Extra:fm=0003
Cell 03 - Address: F4:32:3D:98:9A:39
ESSID:“ChinaNet-6b4R”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.417 GHz (Channel 2)
Encryption key:on
Bit Rates:144 Mb/s
Extra:wpa_ie=dd1a0050f20101000050f20202000050f2040050f20201000050f202
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Quality=0/100 Signal level=18/100
Extra:fm=0001
Cell 04 - Address: CC:81:DA:55:EF:48
ESSID:“@PHICOMM_40”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.417 GHz (Channel 2)
Encryption key:on
Bit Rates:300 Mb/s
Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Extra:
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Quality=0/100 Signal level=14/100
Extra:fm=0001
Cell 05 - Address: F8:CD:C8:90:BC:32
ESSID:“ChinaNet-gTUm”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.432 GHz (Channel 5)
Encryption key:on
Bit Rates:144 Mb/s
Extra:wpa_ie=dd1a0050f20101000050f20202000050f2040050f20201000050f202
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Extra:
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD7D0050F204104A0001101044000101103B000103104700107B882E1F7DD6CD39808942E5FA1712CB1021000842726F6164636F6D1023000842726F6164636F6D1024000431323334104200033236371054000800060050F20400011011000A42726F6164636F6D4150100800022008103C0001031049000600372A000120
Quality=0/100 Signal level=27/100
Extra:fm=0003
Cell 06 - Address: 50:33:F0:CD:21:D9
ESSID:“mywifi”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.432 GHz (Channel 5)
Encryption key:on
Bit Rates:867 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD9F0050F204104A0001101044000102103B00010310470010BC329E001DD811B286015033F0CD21D81021001852616C696E6B20546563686E6F6C6F67792C20436F72702E1023001C52616C696E6B20576972656C6573732041636365737320506F696E74102400065254323836301042000831323334353637381054000800060050F20400011011000B52616C696E6B4150535F3010080002008C103C000101
Quality=0/100 Signal level=33/100
Extra:fm=0003
Cell 07 - Address: 52:33:F0:2D:21:D9
ESSID:“mywifi-WiFi5”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.432 GHz (Channel 5)
Encryption key:on
Bit Rates:867 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD9F0050F204104A0001101044000102103B00010310470010BC329E001DD811B286015033F0CD21D81021001852616C696E6B20546563686E6F6C6F67792C20436F72702E1023001C52616C696E6B20576972656C6573732041636365737320506F696E74102400065254323836301042000831323334353637381054000800060050F20400011011000B52616C696E6B4150535F3210080002008C103C000101
Quality=0/100 Signal level=33/100
Extra:fm=0003
Cell 08 - Address: 52:33:F0:7D:21:D9
ESSID:“”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.432 GHz (Channel 5)
Encryption key:on
Bit Rates:867 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD270050F204104A000110104400010210470010BC329E001DD811B286015033F0CD21D8103C000101
Quality=0/100 Signal level=33/100
Extra:fm=0001
Cell 09 - Address: 08:10:7B:F0:7E:21
ESSID:“zhwww”
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.447 GHz (Channel 8)
Encryption key:on
Bit Rates:780 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DDA90050F204104A0001101044000102103B0001031047001063041253101920191227AABBCCDDEEFF1021001852616C696E6B20546563686E6F6C6F67792C20436F72702E1023001C52616C696E6B20576972656C6573732041636365737320506F696E74102400065254323836301042000831323334353637381054000800060050F20400011011000B52616C696E6B4150535F3010080002218C103C0001011049000600372A000120
Quality=0/100 Signal level=17/100
最全的Linux教程,Linux从入门到精通
======================
-
linux从入门到精通(第2版)
-
Linux系统移植
-
Linux驱动开发入门与实战
-
LINUX 系统移植 第2版
-
Linux开源网络全栈详解 从DPDK到OpenFlow
第一份《Linux从入门到精通》466页
====================
内容简介
====
本书是获得了很多读者好评的Linux经典畅销书**《Linux从入门到精通》的第2版**。本书第1版出版后曾经多次印刷,并被51CTO读书频道评为“最受读者喜爱的原创IT技术图书奖”。本书第﹖版以最新的Ubuntu 12.04为版本,循序渐进地向读者介绍了Linux 的基础应用、系统管理、网络应用、娱乐和办公、程序开发、服务器配置、系统安全等。本书附带1张光盘,内容为本书配套多媒体教学视频。另外,本书还为读者提供了大量的Linux学习资料和Ubuntu安装镜像文件,供读者免费下载。
本书适合广大Linux初中级用户、开源软件爱好者和大专院校的学生阅读,同时也非常适合准备从事Linux平台开发的各类人员。
需要《Linux入门到精通》、《linux系统移植》、《Linux驱动开发入门实战》、《Linux开源网络全栈》电子书籍及教程的工程师朋友们劳烦您转发+评论
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!