Install wifi dongle driver for Cudy: make shows errors

Heya, just bought a Cudy AC1300 wifi usb adapter.
I’m trying to build following the instructions here: Guide
but It seems to need 5.4 or 5.8 kernel and I’m using 5.14. I get errors while running make:

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.14.10-1-MANJARO/build M=/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141  modules
make[1]: Entering directory '/usr/lib/modules/5.14.10-1-MANJARO/build'
  CC [M]  /home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.o
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c: In function 'isFileReadable':
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2223:25: error: implicit declaration of function 'get_fs'; did you mean 'get_sa'? [-Werror=implicit-function-declaration]
 2223 |                 oldfs = get_fs();
      |                         ^~~~~~
      |                         get_sa
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2223:25: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2225:17: error: implicit declaration of function 'set_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
 2225 |                 set_fs(KERNEL_DS);
      |                 ^~~~~~
      |                 sget_fc
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2225:24: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
 2225 |                 set_fs(KERNEL_DS);
      |                        ^~~~~~~~~
      |                        KERNFS_NS
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2225:24: note: each undeclared identifier is reported only once for each function it appears in
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c: In function 'retriveFromFile':
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2265:33: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
 2265 |                         oldfs = get_fs();
      |                                 ^~~~~~
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2267:32: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
 2267 |                         set_fs(KERNEL_DS);
      |                                ^~~~~~~~~
      |                                KERNFS_NS
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c: In function 'storeToFile':
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2304:33: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
 2304 |                         oldfs = get_fs();
      |                                 ^~~~~~
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2306:32: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
 2306 |                         set_fs(KERNEL_DS);
      |                                ^~~~~~~~~
      |                                KERNFS_NS
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: /home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.o] Error 1
make[1]: *** [Makefile:1858: /home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.14.10-1-MANJARO/build'
make: *** [Makefile:2327: modules] Error 2
    ~/w/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141  sudo make > output_make.txt
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c: In function 'isFileReadable':
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2223:25: error: implicit declaration of function 'get_fs'; did you mean 'get_sa'? [-Werror=implicit-function-declaration]
 2223 |                 oldfs = get_fs();
      |                         ^~~~~~
      |                         get_sa
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2223:25: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2225:17: error: implicit declaration of function 'set_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
 2225 |                 set_fs(KERNEL_DS);
      |                 ^~~~~~
      |                 sget_fc
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2225:24: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
 2225 |                 set_fs(KERNEL_DS);
      |                        ^~~~~~~~~
      |                        KERNFS_NS
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2225:24: note: each undeclared identifier is reported only once for each function it appears in
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c: In function 'retriveFromFile':
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2265:33: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
 2265 |                         oldfs = get_fs();
      |                                 ^~~~~~
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2267:32: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
 2267 |                         set_fs(KERNEL_DS);
      |                                ^~~~~~~~~
      |                                KERNFS_NS
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c: In function 'storeToFile':
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2304:33: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
 2304 |                         oldfs = get_fs();
      |                                 ^~~~~~
/home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.c:2306:32: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
 2306 |                         set_fs(KERNEL_DS);
      |                                ^~~~~~~~~
      |                                KERNFS_NS
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: /home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141/os_dep/osdep_service.o] Error 1
make[1]: *** [Makefile:1858: /home/padlock/wu300-driver_linux/rtl8821CU_rtl8731AU_WiFi_linux_v5.8.1.7_37266.20200929_COEX20200616-4141] Error 2
make: *** [Makefile:2327: modules] Error 2

I’ve also tried using the AUR rtl8821cu-dkms-git.

Anyone here know what to do ? It’s not even detected…

It does show up with lsusb:

Bus 003 Device 004: ID 0bda:b812 Realtek Semiconductor Corp. RTL88x2bu [AC1200 Techkey]

though i’m not even sure it’s this one…

They are targeting EOL versions of ubuntu and kernel?
Seems odd.
I guess you can try kernel 5.4 as thats LTS (so it still exists … unlike 5.8) and manjaro allows easy switching.

Really though, it seems to be a branded rtl8821cu, so your AUR package seems like the best bet.
If you ‘tried’ it … what happened?

Here is what I get @cscs :

pamac build rtl8821cu-dkms-git                                                                       ✔ 
Preparing...
Cloning rtl8821cu-dkms-git build files...
Checking rtl8821cu-dkms-git dependencies...
bsdtar: Failed to set default locale
Warning: downgrading package rtl8821cu-dkms-git (5.4.11229828dcb-1 => 5.4.1118f1bc7e8-1)
Resolving dependencies...
Checking inter-conflicts...

To build (1):
  rtl8821cu-dkms-git  5.4.1118f1bc7e8-1  (5.4.11229828dcb-1)  AUR


Edit build files : [e] 
Apply transaction ? [e/y/N] y


Building rtl8821cu-dkms-git...
==> Making package: rtl8821cu-dkms-git 5.4.11229828dcb-1 (Wed Oct 13 12:57:42 2021)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating rtl8821CU git repo...
Fetching origin
  -> Found dkms.conf
==> Validating source files with sha256sums...
    rtl8821CU ... Skipped
    dkms.conf ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of rtl8821CU git repo...
Cloning into 'rtl8821CU'...
done.
==> Starting prepare()...
==> Starting pkgver()...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "rtl8821cu-dkms-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: rtl8821cu-dkms-git 5.4.11229828dcb-1 (Wed Oct 13 12:57:46 2021)
==> Cleaning up...

Checking keyring...                                                                                            [1/1]
Checking integrity...                                                                                          [1/1]
Loading packages files...                                                                                      [1/1]
Checking file conflicts...                                                                                     [1/1]
Checking available disk space...                                                                               [1/1]
Running pre-transaction hooks...
Creating Timeshift snapshot before upgrade...                                                                  [1/2]
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
Remove upgraded DKMS modules                                                                                   [2/2]
==> Unable to remove module rtl8821cu/5.4.11229828dcb for kernel 5.13.19-2-MANJARO: Not found in dkms status output.
==> Unable to remove module rtl8821cu/5.4.11229828dcb for kernel 5.14.10-1-MANJARO: Not found in dkms status output.
==> Unable to remove module rtl8821cu/5.4.11229828dcb for kernel 5.4.150-1-MANJARO: Not found in dkms status output.
Reinstalling rtl8821cu-dkms-git (5.4.11229828dcb-1)...                                                         [1/1]
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                                                 [1/3]
Install DKMS modules                                                                                           [2/3]
==> dkms install --no-depmod -m rtl8821cu -v 5.4.11229828dcb -k 5.13.19-2-MANJARO
==> dkms install --no-depmod -m rtl8821cu -v 5.4.11229828dcb -k 5.14.10-1-MANJARO
Error! Bad return status for module build on kernel: 5.14.10-1-MANJARO (x86_64)
Consult /var/lib/dkms/rtl8821cu/5.4.11229828dcb/build/make.log for more information.
==> Warning, `dkms install --no-depmod -m rtl8821cu -v 5.4.11229828dcb -k 5.14.10-1-MANJARO' returned 10
==> depmod 5.14.10-1-MANJARO
==> depmod 5.13.19-2-MANJARO
==> Unable to install module rtl8821cu/5.4.11229828dcb for kernel 5.4.150-1-MANJARO: Missing kernel modules tree.
Refreshing PackageKit...                                                                                       [3/3]
Transaction successfully finished.

Dunno if that means it’s installed…
I do have linux54-headers installed for what it’s worth.
Do I need to revert to an older kernel ? Or is it possible to install it with 5.14 ?

It looks to me like your kernels are mixed up.
Please make sure you have whatever kernel you want to use installed, and make sure you are updated.
Though we dont know you need 5.4 for the AUR package … thats just from that weird documentation.
So … please make sure you are up to date

pamac update

-reboot-
-select kernel (5.14?)
And please try again.

@cscs
So it does seem to download 5.4:

To build (1):
  rtl8821cu-dkms-git  5.4.1118f1bc7e8-1  (5.4.11229828dcb-1)  AUR

But I did as you asked, nothing to upgrade, rebooted, and using the 5.14 kernel, I build again:

pamac build rtl8821cu-dkms-git                                                                       ✔ 
Preparing...
Cloning rtl8821cu-dkms-git build files...
Checking rtl8821cu-dkms-git dependencies...
bsdtar: Failed to set default locale
Warning: downgrading package rtl8821cu-dkms-git (5.4.11229828dcb-1 => 5.4.1118f1bc7e8-1)
Resolving dependencies...
Checking inter-conflicts...

To build (1):
  rtl8821cu-dkms-git  5.4.1118f1bc7e8-1  (5.4.11229828dcb-1)  AUR


Edit build files : [e] 
Apply transaction ? [e/y/N] y


Building rtl8821cu-dkms-git...
==> Making package: rtl8821cu-dkms-git 5.4.11229828dcb-1 (Wed Oct 13 13:22:51 2021)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating rtl8821CU git repo...
Fetching origin
  -> Found dkms.conf
==> Validating source files with sha256sums...
    rtl8821CU ... Skipped
    dkms.conf ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of rtl8821CU git repo...
Cloning into 'rtl8821CU'...
done.
==> Starting prepare()...
==> Starting pkgver()...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "rtl8821cu-dkms-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: rtl8821cu-dkms-git 5.4.11229828dcb-1 (Wed Oct 13 13:22:56 2021)
==> Cleaning up...

Checking keyring...                                                                                            [1/1]
Checking integrity...                                                                                          [1/1]
Loading packages files...                                                                                      [1/1]
Checking file conflicts...                                                                                     [1/1]
Checking available disk space...                                                                               [1/1]
Running pre-transaction hooks...
Creating Timeshift snapshot before upgrade...                                                                  [1/2]
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
Remove upgraded DKMS modules                                                                                   [2/2]
==> dkms remove --no-depmod -m rtl8821cu -v 5.4.11229828dcb -k 5.13.19-2-MANJARO
==> Unable to remove module rtl8821cu/5.4.11229828dcb for kernel 5.14.10-1-MANJARO: Not found in dkms status output.
Reinstalling rtl8821cu-dkms-git (5.4.11229828dcb-1)...                                                         [1/1]
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                                                 [1/3]
Install DKMS modules                                                                                           [2/3]
==> dkms install --no-depmod -m rtl8821cu -v 5.4.11229828dcb -k 5.13.19-2-MANJARO
==> dkms install --no-depmod -m rtl8821cu -v 5.4.11229828dcb -k 5.14.10-1-MANJARO
==> depmod 5.14.10-1-MANJARO
==> depmod 5.13.19-2-MANJARO
depmod: ERROR: failed to load symbols from /lib/modules/5.13.19-2-MANJARO/kernel/drivers/thermal/intel/intel_pch_thermal.ko.xz: Exec format error
/usr/lib/dkms/alpm-hook: line 21: 25374 Killed                  "$@" > /dev/null
==> Warning, `depmod 5.13.19-2-MANJARO' returned 137
Refreshing PackageKit...                                                                                       [3/3]
Transaction successfully finished.

Is it a problem if I have 5.13 installed but not used ?

Yes. Well, more specific than that.
It may be installed on 5.14 already, but I would guess if you remove 5.13 and/or clean DKMS you would remove the error. Not sure what its exact root is.

Beyond that … after its installed, getting it working may be another step.

In the doc it says I have to add a line in /lib/udev/rules.d/40-usb_modeswitch.rules
and some tar (that i don’t have) in /usr/share/usb_modeswitch/.

I’ve also found rtl88x2bu-dkms-git while looking through reddit. Someone with the same adapter seemed to get it working with this…

But upon building I get a similar result:

pamac build rtl88x2bu-dkms-git                                                                     1 ✘ 
Preparing...
Cloning rtl88x2bu-dkms-git build files...
Checking rtl88x2bu-dkms-git dependencies...
bsdtar: Failed to set default locale
Warning: rtl88x2bu-dkms-git-5.8.7.4.r130.209172c-1 is up to date -- reinstalling
Resolving dependencies...
Checking inter-conflicts...

To build (1):
  rtl88x2bu-dkms-git  5.8.7.4.r130.209172c-1                            AUR


Edit build files : [e] 
Apply transaction ? [e/y/N] y


Building rtl88x2bu-dkms-git...
==> Making package: rtl88x2bu-dkms-git 5.8.7.4.r130.209172c-1 (Wed Oct 13 14:23:13 2021)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating RTL88x2BU-Linux-Driver git repo...
Fetching origin
==> Validating source files with sha256sums...
    RTL88x2BU-Linux-Driver ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of RTL88x2BU-Linux-Driver git repo...
Cloning into 'RTL88x2BU-Linux-Driver'...
done.
==> Starting pkgver()...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "rtl88x2bu-dkms-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: rtl88x2bu-dkms-git 5.8.7.4.r130.209172c-1 (Wed Oct 13 14:23:17 2021)
==> Cleaning up...

Checking keyring...                                                                                            [1/1]
Checking integrity...                                                                                          [1/1]
Loading packages files...                                                                                      [1/1]
Checking file conflicts...                                                                                     [1/1]
Checking available disk space...                                                                               [1/1]
Running pre-transaction hooks...
Creating Timeshift snapshot before upgrade...                                                                  [1/2]
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
Remove upgraded DKMS modules                                                                                   [2/2]
==> Unable to remove module rtl88x2bu/5.8.7.4.r130.209172c for kernel 5.14.10-1-MANJARO: Not found in dkms status output.
Reinstalling rtl88x2bu-dkms-git (5.8.7.4.r130.209172c-1)...                                                    [1/1]
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                                                 [1/3]
Install DKMS modules                                                                                           [2/3]
==> dkms install --no-depmod -m rtl88x2bu -v 5.8.7.4.r130.209172c -k 5.14.10-1-MANJARO
Error! Bad return status for module build on kernel: 5.14.10-1-MANJARO (x86_64)
Consult /var/lib/dkms/rtl88x2bu/5.8.7.4.r130.209172c/build/make.log for more information.
==> Warning, `dkms install --no-depmod -m rtl88x2bu -v 5.8.7.4.r130.209172c -k 5.14.10-1-MANJARO' returned 10
==> depmod 5.14.10-1-MANJARO
Refreshing PackageKit...                                                                                       [3/3]
Transaction successfully finished.

How do I clean up DKMS ?
Sould I just send it back and get an adaptor that is know to work ?

In the end, building this got it to work: GitHub - fastoe/RTL8812BU: Realtek RTL8812BU Driver for Linux

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.