# imported from, # git #old https://github.com/brektrou/rtl8821CU/tree/5.8.1 #old https://github.com/mbrysa/rtl8821CU ### thx to Ed #### #new real version 5.12.0 https://github.com/morrownr/8821cu-20210118 %global module 8821cu %global pname rtl%{module} #%global lname %{pname}-legacy Name: dkms-%{pname} Version: 5.12.0 Release: %mkrel 1 Source0: %{pname}-%{version}.tar.xz License: GPLv2 Group: System/Kernel and hardware URL: https://github.com/morrownr/8821cu Summary: dkms package for realtek RTL8811CU, RTL8821CU and RTL8731AU Chipsets Patch0: rtl8821cu-pclos-%{version}.patch Patch1: rtl8821cu-conffile-%{version}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Provides: kmod(rtl%{module}.ko) = %{version} Requires(post): dkms Requires(preun): dkms Obsoletes: dkms-%{pname} < %{version}-%{release} %description Linux Driver for USB WiFi Adapters that are based on the RTL8811CU, RTL8821CU and RTL8731AU Chipsets v5.12.0 (Realtek) (20210118) plus updates from the Linux community Features IEEE 802.11 b/g/n/ac WiFi compliant 802.1x, WEP, WPA TKIP and WPA2 AES/Mixed mode for PSK and TLS (Radius) WPA3 (see FAQ) IEEE 802.11b/g/n/ac Client mode Supports wireless security for WEP, WPA TKIP and WPA2 AES PSK Supports site survey scan and manual connect Supports WPA/WPA2 TLS client IEEE 802.11k Client and AP mode support Power saving modes Wireshark compatible Aircrack-ng compatible Packet injection hostapd compatible AP mode DFS channel support Miracast Supported interface modes IBSS Managed Monitor (see Monitor_Mode.md in the docs folder.) AP (see AP_Mode-Bridged_Wireless_Access_Point.md in the docs folder.) P2P-client P2P-GO Concurrent (see Concurrent_Mode.md in the docs folder.) Log level control Power saving control VHT control (allows 80 MHz channel width in AP mode) SU Beamformee and MU Beamformee control AP mode DFS channel control FAQ: Question: Is WPA3 supported? Answer: WPA3-SAE support is in this driver according to Realtek, however, for it to work in client mode with some current Linux distros, you will need to download, compile and install the current development version of wpa_supplicant from the following site: https://w1.fi/cgit/ Note: There is a file in the docs folder called Update_wpa_supplicant_v3a.md that may help with updating wpa_supplicant. WPA3-SAE is working well in AP mode using hostapd with the Raspberry Pi OS. Question: I bought two rtl8811cu based adapters and am planning to run one of them as an AP and another as a WiFi client. How do I set that up? Answer: You can't without considerable technical skills. Realtek drivers do not support more than one adapter with the same chipset in the same computer. You can have multiple Realtek based adapters in the same computer as long as the adapters are based on different chipsets. Question: Why do you recommend Mediatek based adapters when you maintain this repo for a Realtek driver? Answer: Many new and existing Linux users already have adapters based on Realtek chipsets. This repo is for Linux users to support their existing adapters but my STRONG recommendation is for Linux users to seek out USB WiFi solutions based on Mediatek, https://github.com/morrownr/USB-WiFi Question: Will you put volunteers to work? Answer: Yes. Post a message in Issues or Discussions if interested. Question: I am having problems with my adapter and I use Virtualbox? Answer: This article (https://null-byte.wonderhowto.com/forum/wifi-hacking-attach-usb-wireless-adapter-with-virtual-box-0324433/) may help. Help is appreciated. Compatible CPUs x86, amd64 ARM, ARM64 Compatible Kernels Kernels: 4.14 - 5.11 (Realtek) Kernels: 5.12 - 5.17 (community support) Tested Hardware EDUP EP-AC1651 USB WiFi Adapter AC650 Dual Band USB 2.0 Nano EDUP EP-AC1635 USB WiFi Adapter AC600 Dual Band USB 2.0 Compatible Devices Cudy WU700 BrosTrend AC5L EDUP EP-AC1651 EDUP EP-AC1635 D-Link - DWA-171C TOTOLINK A650UA v3 Mercusys MU6H (multi-state) Numerous additional products that are based on the supported chipsets Note: Please read "supported-device-IDs" for information about how to confirm the correct driver for your adapter. if you would automatic switch into wifi-mode even the dongle is pluged-in, then add in /etc/udev/rules.d/ 90-rtl8821CU.rules ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="1a2b", RUN+="/usr/sbin/usb_modeswitch -KW -v 0bda -p 1a2b" Driver Options !!! Documentation for Driver Options is included in the file 8821cu.conf. !!! A file called 8821cu.conf will be installed in /etc/modeprob.d by default. Location: /etc/modprobe.d/8821cu.conf This file will be read and applied to the driver on each system boot. To edit the driver options file, run the edit-options.sh script. as root do ./edit-options.sh %prep %setup -qn %{pname}-%{version} find -type f -exec chmod 0644 {} \; %apply_patches %install %__rm -rf %{buildroot} %__install -dm755 %{buildroot}/etc/modprobe.d %__install -dm755 %{buildroot}%{_usrsrc}/%{pname}-%{version}-%{release} %__cp -a . %{buildroot}%{_usrsrc}/%{pname}-%{version}-%{release} mkdir -p %{buildroot}/usr/share/doc/%{name} %__mv -f %{buildroot}%{_usrsrc}/%{pname}-%{version}-%{release}/docs/*.md %{buildroot}/usr/share/doc/%{name}/ %__rm -rf %{buildroot}%{_usrsrc}/%{pname}-%{version}-%{release}/docs %__mv -f %{buildroot}%{_usrsrc}/%{pname}-%{version}-%{release}/8821cu.conf %{buildroot}/etc/modprobe.d/rtl8821cu.conf %__cat < %{buildroot}%{_usrsrc}/%{pname}-%{version}-%{release}/dkms.conf PACKAGE_NAME="%{pname}" PACKAGE_VERSION="%{version}-%{release}" BUILT_MODULE_NAME="%{pname}" BUILT_MODULE_LOCATION="./" MAKE="export IGNORE_CC_MISMATCH=1; 'make' clean KSRC=\${kernel_source_dir} SKIP_STACK_VALIDATION=1 all" DEST_MODULE_LOCATION="/kernel/3rdparty/%{pname}" AUTOINSTALL="yes" CLEAN="make clean" EOF %post -n %{name} /usr/sbin/dkms --rpm_safe_upgrade add -m %{pname} -v %{version}-%{release} /usr/sbin/dkms --rpm_safe_upgrade build -m %{pname} -v %{version}-%{release} /usr/sbin/dkms --rpm_safe_upgrade install -m %{pname} -v %{version}-%{release} if [ "$1" = 1 ]; then if [ -f /etc/NetworkManager/NetworkManager.conf ]; then randmacad=`grep "wifi.scan-rand-mac-address=no" /etc/NetworkManager/NetworkManager.conf` fi if [ "$randmacad" = z ]; then echo " [device] wifi.scan-rand-mac-address=no " >> /etc/NetworkManager/NetworkManager.conf fi /sbin/modprobe cfg80211 >/dev/null 2>&1 /sbin/modprobe %{pname} >/dev/null 2>&1 echo "Reloading network configuration ... " /sbin/service network reload >/dev/null 2>&1 echo "%{pname}" >> /etc/modprobe.preload fi %preun -n %{name} /usr/sbin/dkms --rpm_safe_upgrade remove -m %{pname} -v %{version}-%{release} --all if [ "$1" = 0 ]; then /sbin/rmmod %{pname} >/dev/null 2>&1 echo "Reloading network configuration ... " /sbin/service network reload >/dev/null 2>&1 sed -i '/%{pname}/ d' /etc/modprobe.preload fi ## remove module-destdir just if it empty after dkms remove,(user's only deinstall after testing)... ## ## so prevent we not have empty folders in kernel-tree for next mklivecd ## if [ ! -f /lib/modules/*/kernel/3rdparty/%{pname}/* ]; then rm -r /lib/modules/*/kernel/3rdparty/%{pname} >/dev/null 2>&1 fi %clean %__rm -rf %{buildroot} %files %defattr(-,root,root) %doc README.md LICENSE supported-device-IDs %{_usrsrc}/%{pname}-%{version}-%{release} %config(noreplace) /etc/modprobe.d/rtl8821cu.conf %changelog * Thu Feb 17 2022 onkelho - 5.12.0-1pclos2022 - new version released - morrownr activate 80211K support c3163f0 2 days ago * Tue Feb 08 2022 onkelho - 5.8.1.7-9pclos2022 - rebuid - ?SYS?K?SRC=\${kernel_source_dir}, := -> ?= in MAKE * Mon Jan 31 2022 onkelho - 5.8.1.7-8pclos2022 - updates kerv-5.17 - add export IGNORE_CC_MISMATCH=1; * Thu Jan 27 2022 onkelho - 5.8.1.7-7pclos2022 - updates * Thu Dec 23 2021 onkelho - 5.8.1.7-6pclos2021 - rebuild minor updates * Sun Dec 05 2021 onkelho - 5.8.1.7-5pclos2021 - rebuild -- add 0bda:c82c 499f495 11 days ago 123 commits - add in %post modprobe cfg80211 - add docs/* to doc - add conf * Thu Nov 11 2021 onkelho - 5.8.1.7-4pclos2021 - rebuild -- minor updates: - - committed 2 days ago - - 1 parent 4e2d84c commit 7850887729b52da9bd273f170ab8757709b8e40a * Sun Oct 24 2021 onkelho - 5.8.1.7-3pclos2021 - minor updates * Mon Oct 11 2021 onkelho - 5.8.1.7-2pclos2021 - support for kernel 5.15 9cba74a 27 days ago Git stats 118 commits * Mon Sep 06 2021 onkelho - 5.8.1.7-1pclos2021 - switch to new source and release 5.8.1.7 * Sat Sep 04 2021 onkelho - 5.8.1-4pclos2021 - update * Thu Aug 20 2020 onkelho - 5.8.1-3pclos2020 - rebuild - rebase source * Thu Apr 09 2020 onkelho - 5.8.1-2pclos2020 - rebuild fix kernel-5.6... on updated source * Mon Feb 17 2020 onkelho - 5.8.1-1pclos2020 - new ver-rel Realtek on - Disable power save - Enable monitor mode - Enable VHT * Mon Feb 17 2020 onkelho - 5.4.1-4pclos2020 - rebuild - fix working on kernel-5.3.., 5.4.., 5.5... - Fix FCS on 8821cu #33 from pbeyl/master Latest commit fa09e80 on Jan 16 * Wed Oct 23 2019 onkelho - 5.4.1-3pclos2019 - rebuild - fix working on kernel-5.3...and 5.4.. * Mon Jul 15 2019 onkelho 5.4.1-1pclos2019 - new ver - rel * Mon Mar 11 2019 onkelho 5.2.5.3-6pclos2019 - rebuild * Sat Jan 12 2019 onkelho 5.2.5.3-5pclos2019 - rebuild --add patch0 * Sat Nov 24 2018 onkelho 5.2.5.3-3pclos2018 - rebuild * Thu Nov 22 2018 onkelho - 5.2.5.3-1pclos2018 - initial build on pclos