centos 7.6 kernel 內核升級和RTL8811CU驅動安裝

爲了安裝RTL8811CU無限網卡驅動:

參考:https://github.com/brektrou/rtl8821CU

Realtek RTL8811CU/RTL8821CU USB wifi adapter driver version 5.4.1 for Linux 4.4.x up to 5.6.x

內核準備:

要求是4.4到5.6的,這裏我選擇更新到5.5.9,內核更新主要安裝:

You may retrieve signed binary configuration files from one the above two links (varying by the major release number of the installation target machine). They may be automatically installed by root thus:

不裝headers和devel無法繼續安驅動

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

第三方網址:https://centos.pkgs.org/7/elrepo-kernel-x86_64/kernel-ml-devel-5.5.9-1.el7.elrepo.x86_64.rpm.html

kernel-ml-headers-5.5.9-1.el7.elrepo.x86_64

sudo yum install https://mirror.rackspace.com/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-headers-5.5.9-1.el7.elrepo.x86_64.rpm

kernel-ml-devel-5.5.9-1.el7.elrepo.x86_64

sudo yum install https://mirror.rackspace.com/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-5.5.9-1.el7.elrepo.x86_64.rpm

kernel-ml-5.5.9-1.el7.elrepo.x86_64

sudo yum install https://mirror.rackspace.com/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-5.5.9-1.el7.elrepo.x86_64.rpm

最後,rpm -qa|grep kernel,獲取安裝過的列表。

dkms準備:

DKMS is a system which will automatically recompile and install a kernel module when a new kernel gets installed or updated. To make use of DKMS, install the dkms package.

###centos

rpm -ivh epel-release-7-0.2.noarch.rpm

yum -y install dkms

### Debian/Ubuntu:
```
sudo apt-get install dkms
```
### Arch Linux/Manjaro:
```
sudo pacman -S dkms
```

驅動:
第一種方法:
```
mkdir -p ~/build
cd ~/build
git clone https://github.com/brektrou/rtl8821CU.git
```
To make use of the **DKMS** feature with this project, just run:
```
./dkms-install.sh
```
If you later on want to remove it, run:
```
./dkms-remove.sh
```

第二種方法,直接

## Build and install without DKMS
Use following commands:
```
cd ~/build/rtl8821CU
make
sudo make install
```
If you later on want to remove it, do the following:
```
cd ~/build/rtl8821CU
sudo make uninstall
```

驅動如果檢測出問題了:

### Plug your USB-wifi-adapter into your PC
If wifi can be detected, congratulations.
If not, maybe you need to switch your device usb mode by the following steps in terminal:
1. find your usb-wifi-adapter device ID, like "0bda:1a2b", by type:
```
lsusb
```
2. switch the mode by type: (the device ID must be yours.) 改變模式

Need install `usb_modeswitch` (Archlinux: `sudo pacman -S usb_modeswitch`)
```
sudo usb_modeswitch -KW -v 0bda -p 1a2b
systemctl start bluetooth.service - starting Bluetooth service if it's in inactive state
```
驅動檢查:
If you successfully install the driver, the driver is installed on `/lib/modules/<linux version>/kernel/drivers/net/wireless/realtek/rtl8821cu`. Check the driver with the `ls` command:
```
ls /lib/modules/$(uname -r)/kernel/drivers/net/wireless/realtek/rtl8821cu
```
Make sure `8821cu.ko` file present on that directory

### Check with **DKMS** (if installing via **DKMS**):

``
sudo dkms status
``
### ARM architecture tweak for this driver (this solves compilation problem of this driver):
```
sudo cp /lib/modules/$(uname -r)/build/arch/arm/Makefile /lib/modules/$(uname -r)/build/arch/arm/Makefile.$(date +%Y%m%d%H%M)
sudo sed -i 's/-msoft-float//' /lib/modules/$(uname -r)/build/arch/arm/Makefile
sudo ln -s /lib/modules/$(uname -r)/build/arch/arm /lib/modules/$(uname -r)/build/arch/armv7l
```
### Monitor mode
Use the tool 'iw', please don't use other tools like 'airmon-ng'
```
iw dev wlan0 set monitor none
```

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章