如何在Ubuntu 18.04與20.04上安裝RTL88x2B系列無線網卡驅動

前言

筆者因為房間本來牽的網路線年久失修,已經無法再繼續使用,又不想再牽一條有線網路再加上之前我已經建好無線路由器在種花電信的數據機旁邊了,因此動了想要使用無線網卡的念頭,再加上最近USB無線網卡也沒有到很貴,因此決定在我的Ubuntu 18.04上設定、使用與安裝。

無線網卡型號

首先,要先知道的是Linux作業系統是以Kernel為基礎的,所有有關的驅動都跟它有關,而Kernel也是以module模組為基礎的,換句話說,讀寫硬碟有專門的驅動模組,而操作顯示卡也有專門的模組,這也就是為什麼多數的嵌入式作業系統之大小可以這麼小的原因,因為只留下了需要用到的驅動模組而已,其他的沒有用到則不需要掛到嵌入式作業系統中。所以無線網卡驅動也是如此。

在經過一些測試之後,目前發現以Realtek RTL88x2B這個無線網卡晶片型號最好安裝與使用,其他的目前我都沒有安裝與設定成功。以這個型號做出來的USB無線網卡品牌主要之產品如下:

  • EDIMAX 訊舟 EW-7822UAD AC1200 雙頻 長距離USB 3.0無線網路卡
  • ASUS華碩 USB-AC55_B1 雙頻AC1300 USB網路卡(Wi-Fi網卡)
  • D-Link友訊 DWA-182 AC1300 MU-MIMO雙頻USB3.0無線網卡

目前測試過得Kernel版本如下:

  • 5.4, 通常會顯示5.4.0-91-generic這樣的版本號,指的是5.4版本,下面5.3版本也是如同。
  • 5.3

若不知道自己的作業系統的Kernel版本的話,則可以使用下列的指令進行查看:


localadmin@clickhouse02:~$ uname -r
5.4.0-91-generic

安裝無線網卡

  •  依照之前的經驗,官網所提供的Linux無線網卡編譯完成之後,都不會運行,或是編譯失敗。
  • 有些官網提供的Linux無線網卡不像是一個完整的安裝檔或套件,通常都是裡面有滿滿C的專案。
  • 像上面那樣的專案,大概只有開發這個無線網卡驅動的工程師才看的懂吧XD。
  • 後來在谷歌深度的找尋之後,才找到RTL88x2BU-Linux-Driver這個放在GitHub上面的專案。

首先,我們先利用Git這個指令將上面這個專案給下載回來,git指令不熟沒有關係,這邊只是拿來作下載而已,若git沒有安裝的話則可以使用apt或是apt-get之指令先將git指令相關的套件安裝起來:


localadmin@clickhouse02:~$ sudo apt-get update
Hit:1 http://tw.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://tw.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://tw.archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 88.7 kB in 1s (67.5 kB/s)
Reading package lists... Done

localadmin@clickhouse02:~$ git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver

Command 'git' not found, but can be installed with:

sudo apt install git

localadmin@clickhouse02:~$ sudo apt-get install git
[sudo] password for localadmin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,750 kB of archives.
After this operation, 34.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://tw.archive.ubuntu.com/ubuntu bionic/main amd64 liberror-perl all 0.17025-1 [22.8 kB]
Get:2 http://tw.archive.ubuntu.com/ubuntu bionic-updates/main amd64 git-man all 1:2.17.1-1ubuntu0.9 [803 kB]
Get:3 http://tw.archive.ubuntu.com/ubuntu bionic-updates/main amd64 git amd64 1:2.17.1-1ubuntu0.9 [3,923 kB]
Fetched 4,750 kB in 0s (10.0 MB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 173402 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17025-1_all.deb ...
Unpacking liberror-perl (0.17025-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.17.1-1ubuntu0.9_all.deb ...
Unpacking git-man (1:2.17.1-1ubuntu0.9) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.17.1-1ubuntu0.9_amd64.deb ...
Unpacking git (1:2.17.1-1ubuntu0.9) ...
Setting up git-man (1:2.17.1-1ubuntu0.9) ...
Setting up liberror-perl (0.17025-1) ...
Setting up git (1:2.17.1-1ubuntu0.9) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
localadmin@clickhouse02:~$

localadmin@clickhouse02:~$ git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver
Cloning into 'RTL88x2BU-Linux-Driver'...
remote: Enumerating objects: 2632, done.
remote: Counting objects: 100% (1262/1262), done.
remote: Compressing objects: 100% (773/773), done.
remote: Total 2632 (delta 711), reused 780 (delta 483), pack-reused 1370
Receiving objects: 100% (2632/2632), 10.48 MiB | 6.10 MiB/s, done.
Resolving deltas: 100% (1487/1487), done.
localadmin@clickhouse02:~$

下載好專案之後,因為需要編譯此專案的驅動,因此要先安裝好編譯的編譯器與相關的指令,像是make與C編譯器。相關安裝的指令如下:


localadmin@clickhouse02:~$ sudo apt-get install -y build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
build-essential
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,758 B of archives.
After this operation, 20.5 kB of additional disk space will be used.
Get:1 http://tw.archive.ubuntu.com/ubuntu bionic/main amd64 build-essential amd64 12.4ubuntu1 [4,758 B]
Fetched 4,758 B in 0s (275 kB/s)
Selecting previously unselected package build-essential.
(Reading database ... 174300 files and directories currently installed.)
Preparing to unpack .../build-essential_12.4ubuntu1_amd64.deb ...
Unpacking build-essential (12.4ubuntu1) ...
Setting up build-essential (12.4ubuntu1) ...
localadmin@clickhouse02:~$

接著,切換到這個專案的目錄底下並執行make指令讓此無線網卡進行編譯,這邊以Kernel 5.4版本為例,相關操作如下:


localadmin@clickhouse02:~$ cd RTL88x2BU-Linux-Driver/
localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.4.0-91-generic/build M=/home/localadmin/RTL88x2BU-Linux-Driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-91-generic'
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_cmd.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_security.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_debug.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_io.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_ioctl_query.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_ioctl_set.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_ieee80211.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_mlme.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_mlme_ext.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_mi.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_wlan_util.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_vht.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_pwrctrl.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_rf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_chplan.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/monitor/rtw_radiotap.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_recv.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_sta_mgt.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_ap.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/wds/rtw_wds.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/mesh/rtw_mesh.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/mesh/rtw_mesh_pathtbl.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/mesh/rtw_mesh_hwmp.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_xmit.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_p2p.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_rson.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_tdls.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_br_ext.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_iol.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_sreset.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_btcoex_wifionly.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_btcoex.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_beamforming.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_odm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_rm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_rm_fsm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_ft.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_wnm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_mbo.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_rm_util.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/efuse/rtw_efuse.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_roch.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-internal.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-internal-enc.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-gcm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-ccm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-omac1.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/ccmp.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/gcmp.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-siv.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/aes-ctr.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/sha256-internal.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/sha256.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/sha256-prf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/crypto/rtw_crypto_wrap.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_swcrypto.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/osdep_service.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/os_intfs.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/usb_intf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/usb_ops_linux.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/ioctl_linux.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/xmit_linux.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/mlme_linux.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/recv_linux.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/ioctl_cfg80211.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/rtw_cfgvendor.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/wifi_regd.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/rtw_android.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/rtw_proc.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/nlrtw.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/rtw_rhashtable.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/os_dep/linux/ioctl_mp.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_intf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_com.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_com_phycfg.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_phy.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_dm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_dm_acs.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_btcoex_wifionly.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_btcoex.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_mp.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_mcc.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_hci/hal_usb.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/led/hal_led.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/led/hal_usb_led.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/rtl8822b_halinit.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/rtl8822b_mac.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/rtl8822b_cmd.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/rtl8822b_phy.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/rtl8822b_ops.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/hal8822b_fw.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_halinit.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_halmac.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_io.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_xmit.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_recv.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_led.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/rtl8822b/usb/rtl8822bu_ops.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/efuse/rtl8822b/HalEfuseMask8822B_USB.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/hal_halmac.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_api.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_dbg.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_bb_rf_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_cfg_wmac_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_common_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_efuse_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_flash_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_fw_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_gpio_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_init_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_mimo_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_usb_88xx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_cfg_wmac_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_common_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_gpio_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_init_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_phy_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_pwr_seq_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/halmac/halmac_88xx/halmac_8822b/halmac_usb_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_debug.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_antdiv.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_soml.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_smt_ant.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_antdect.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_interface.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_phystatus.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_hwconfig.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_dig.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_pathdiv.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_rainfo.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_dynamictxpower.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_adaptivity.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_cfotracking.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_noisemonitor.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_beamforming.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_direct_bf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_dfs.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/txbf/halcomtxbf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/txbf/haltxbfinterface.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/txbf/phydm_hal_txbf_api.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_adc_sampling.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_ccx.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_psd.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_primary_cca.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_cck_pd.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_rssi_monitor.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_auto_dbg.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_math_lib.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_api.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_pow_train.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_lna_sat.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_pmac_tx_setting.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_mp.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/phydm_cck_rx_pathdiv.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halrf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halrf_debug.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halphyrf_ce.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halrf_powertracking_ce.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halrf_powertracking.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halrf_kfree.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/halrf_psd.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/rtl8822b/halhwimg8822b_bb.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/rtl8822b/halhwimg8822b_mac.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/rtl8822b/halrf_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/rtl8822b/phydm_hal_api8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/rtl8822b/halhwimg8822b_rf.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/rtl8822b/halrf_iqk_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/halrf/rtl8822b/halrf_rfk_init_8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/rtl8822b/phydm_regconfig8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/rtl8822b/phydm_rtl8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/phydm/txbf/haltxbf8822b.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/btc/halbtc8822bwifionly.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/btc/halbtc8822b1ant.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/hal/btc/halbtc8822b2ant.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/platform/platform_ops.o
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/core/rtw_mp.o
LD [M] /home/localadmin/RTL88x2BU-Linux-Driver/88x2bu.o
Building modules, stage 2.
MODPOST 1 modules
CC [M] /home/localadmin/RTL88x2BU-Linux-Driver/88x2bu.mod.o
LD [M] /home/localadmin/RTL88x2BU-Linux-Driver/88x2bu.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-91-generic'
localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$

從上面的操作訊息來看,代表這樣已經編譯成功了,接著再安裝驅動,相關的指令如下:


localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$ sudo make install
install -p -m 644 88x2bu.ko /lib/modules/5.4.0-91-generic/kernel/drivers/net/wireless/
/sbin/depmod -a 5.4.0-91-generic
localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$

安裝好驅動之後,接著再重新開機:


localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$ sudo systemctl reboot
localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$ Connection to 192.168.1.46 closed by remote host.
Connection to 192.168.1.46 closed.

若要解除安裝無線網卡驅動,則使用下列的指令即可:

localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$ sudo make uninstall 
[sudo] password for localadmin: 
rm -f /lib/modules/5.4.0-91-generic/kernel/drivers/net/wireless//88x2bu.ko
/sbin/depmod -a 5.4.0-91-generic
localadmin@clickhouse02:~/RTL88x2BU-Linux-Driver$ 

到這邊,驅動就安裝完成了,等機器重新開好機之後,把USB無線網卡插上去就可以開始上網衝浪了!

參考資料

  • https://github.com/RinCat/RTL88x2BU-Linux-Driver