Failed build DKMS rtl8xxxu driver

So here is the following commands that I ran:

    ~/Desktop  git clone https://github.com/johnheenan/rtl8xxxu.git                       ✔ 
cd rtl8xxxu
make install

Cloning into 'rtl8xxxu'...
remote: Enumerating objects: 29, done.
remote: Total 29 (delta 0), reused 0 (delta 0), pack-reused 29
Receiving objects: 100% (29/29), 93.72 KiB | 376.00 KiB/s, done.
Resolving deltas: 100% (15/15), done.
make -C /lib/modules/5.15.16-1-MANJARO/build M=/home/mi/Desktop/rtl8xxxu modules
> make[1]: *** /lib/modules/5.15.16-1-MANJARO/build: No such file or directory.  Stop.
> make: *** [Makefile:14: modules] Error 2
    ~/De/rtl8xxxu    master                                                   2 ✘  7s  

I received the following error when trying to run the make install command:

> make[1]: *** /lib/modules/5.15.16-1-MANJARO/build: No such file or directory.  Stop.
> make: *** [Makefile:404: LINUX] Error 2

My wifi adapter name is tl-wn821n, here is my system information:

System:
  Kernel: 5.15.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=8e690f70-16f3-4b74-9a43-755d2884f1b1 rw apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma 5.23.5 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Portable System: Dell product: Dell System Inspiron N411Z v: N/A
    serial: <superuser required> Chassis: type: 8 v: 0.1
    serial: <superuser required>
  Mobo: Dell model: 0NFVTW v: FAB1 serial: <superuser required>
    UEFI-[Legacy]: Dell v: A04 date: 02/29/2012
Battery:
  ID-1: BAT0 charge: N/A condition: N/A volts: 3.9 min: 11.1
    model: SIMPLO Dell type: Li-ion serial: <filter> status: N/A
Memory:
  RAM: total: 7.65 GiB used: 2.46 GiB (32.2%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i5-2450M bits: 64 type: MT MCP arch: Sandy Bridge
    family: 6 model-id: 0x2A (42) stepping: 7 microcode: 0x2F
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
    L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB
    L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 985 high: 1250 min/max: 800/3100 scaling:
    driver: intel_cpufreq governor: schedutil cores: 1: 819 2: 881 3: 992
    4: 1250 bogomips: 19961
  Flags: acpi aes aperfmperf apic arat arch_perfmon avx bts clflush cmov
    constant_tsc cpuid cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept est
    flexpriority flush_l1d fpu fxsr ht ibpb ibrs ida lahf_lm lm mca mce
    md_clear mmx monitor msr mtrr nonstop_tsc nopl nx pae pat pbe pcid
    pclmulqdq pdcm pebs pge pln pni popcnt pse pse36 pti pts rdtscp sep ssbd
    sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc
    tsc_deadline_timer vme vmx vnmi vpid x2apic xsave xsaveopt xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf
    mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional,
    IBRS_FW, STIBP: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
    vendor: Dell driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:0126
    class-ID: 0300
  Device-2: Sunplus Innovation Laptop_Integrated_Webcam_HD type: USB
    driver: uvcvideo bus-ID: 1-1.4:3 chip-ID: 1bcf:2b80 class-ID: 0e02
  Display: x11 server: X.org 1.21.1.3 compositor: kwin_x11 driver:
    loaded: modesetting alternate: fbdev,vesa resolution: <missing: xdpyinfo>
  Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio
    vendor: Dell driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
    chip-ID: 8086:1c20 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.16-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.43 running: yes
Network:
  Device-1: Intel Centrino Wireless-N 1030 [Rainbow Peak] driver: iwlwifi
    v: kernel bus-ID: 02:00.0 chip-ID: 8086:008a class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Qualcomm Atheros AR8152 v2.0 Fast Ethernet vendor: Dell
    driver: atl1c v: kernel port: 2000 bus-ID: 04:00.0 chip-ID: 1969:2062
    class-ID: 0200
  IF: enp4s0 state: down mac: <filter>
  Device-3: TP-Link TL-WN821N v5/v6 [RTL8192EU] type: USB driver: rtl8xxxu
    bus-ID: 2-1.2:3 chip-ID: 2357:0107 class-ID: 0000 serial: <filter>
  IF: wlp0s29u1u2 state: down mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Centrino Advanced-N 6230 Bluetooth adapter type: USB
    driver: btusb v: 0.8 bus-ID: 2-1.5:4 chip-ID: 8086:0189 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 111.79 GiB used: 23.29 GiB (20.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Hikvision
    model: HKVSN HS-SSD-C100 120G size: 111.79 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 7C
    scheme: MBR
  Optical-1: /dev/sr0 vendor: TSSTcorp model: DVD+-RW TS-U633J rev: D800
    dev-links: cdrom
  Features: speed: 24 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition:
  ID-1: / raw-size: 30.27 GiB size: 29.63 GiB (97.87%) used: 23.29 GiB (78.6%)
    fs: ext4 dev: /dev/sda4 maj-min: 8:4 label: N/A
    uuid: 8e690f70-16f3-4b74-9a43-755d2884f1b1
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/sda1 maj-min: 8:1 size: 549 MiB fs: ntfs label: System Reserved
    uuid: C2F21771F21768C5
  ID-2: /dev/sda2 maj-min: 8:2 size: 42.9 GiB fs: ntfs label: Windows
    uuid: 94B81A0DB819EF0C
  ID-3: /dev/sda3 maj-min: 8:3 size: 37.57 GiB fs: ntfs label: N/A
    uuid: 5AB4FC8FB4FC6F3F
USB:
  Hub-1: 1-0:1 info: Full speed or root hub ports: 2 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 1-1:2 info: Intel Integrated Rate Matching Hub ports: 6 rev: 2.0
    speed: 480 Mb/s chip-ID: 8087:0024 class-ID: 0900
  Device-1: 1-1.4:3 info: Sunplus Innovation Laptop_Integrated_Webcam_HD
    type: Video driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s
    power: 500mA chip-ID: 1bcf:2b80 class-ID: 0e02
  Device-2: 1-1.5:4 info: Realtek RTS5138 Card Reader Controller
    type: Mass Storage driver: ums-realtek interfaces: 1 rev: 2.0
    speed: 480 Mb/s power: 500mA chip-ID: 0bda:0138 class-ID: 0806
    serial: <filter>
  Hub-3: 2-0:1 info: Full speed or root hub ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-4: 2-1:2 info: Intel Integrated Rate Matching Hub ports: 8 rev: 2.0
    speed: 480 Mb/s chip-ID: 8087:0024 class-ID: 0900
  Device-1: 2-1.2:3 info: TP-Link TL-WN821N v5/v6 [RTL8192EU] type: Network
    driver: rtl8xxxu interfaces: 1 rev: 2.1 speed: 480 Mb/s power: 500mA
    chip-ID: 2357:0107 class-ID: 0000 serial: <filter>
  Device-2: 2-1.5:4 info: Intel Centrino Advanced-N 6230 Bluetooth adapter
    type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s
    chip-ID: 8086:0189 class-ID: e001
  Hub-5: 3-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-6: 4-0:1 info: Super-speed hub ports: 2 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 76.0 C mobo: 46.0 C sodimm: SODIMM C
  Fan Speeds (RPM): cpu: 4568
Info:
  Processes: 218 Uptime: 30m wakeups: 1 Init: systemd v: 250 tool: systemctl
  Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: 1295 pacman: 1282 lib: 355
  flatpak: 0 snap: 13 Shell: Zsh v: 5.8 default: Bash v: 5.1.16
  running-in: yakuake inxi: 3.3.12

Install linux-headers package for your specific kernel. In your case:

sudo pacman -S linux515-headers

#or to install for all kernels at once

sudo  pacman -S $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-headers"}' ORS=' ')
1 Like

I received another error after installing inux515-headers:

    ~/De/rtl8xxxu    master  make                                              ✔  24s  
make -C /lib/modules/5.15.16-1-MANJARO/build M=/home/mi/Desktop/rtl8xxxu modules
make[1]: Entering directory '/usr/lib/modules/5.15.16-1-MANJARO/build'
  CC [M]  /home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.o
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_rx_parse_phystats’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5036:36: error: ‘RX_FLAG_SHORT_GI’ undeclared (first use in this function); did you mean ‘RX_ENC_FLAG_SHORT_GI’?
 5036 |                 rx_status->flag |= RX_FLAG_SHORT_GI;
      |                                    ^~~~~~~~~~~~~~~~
      |                                    RX_ENC_FLAG_SHORT_GI
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5036:36: note: each undeclared identifier is reported only once for each function it appears in
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_parse_rxdesc16’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5262:44: error: ‘RX_FLAG_40MHZ’ undeclared (first use in this function); did you mean ‘RX_FLAG_8023’?
 5262 |                         rx_status->flag |= RX_FLAG_40MHZ;
      |                                            ^~~~~~~~~~~~~
      |                                            RX_FLAG_8023
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5265:44: error: ‘RX_FLAG_HT’ undeclared (first use in this function)
 5265 |                         rx_status->flag |= RX_FLAG_HT;
      |                                            ^~~~~~~~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_parse_rxdesc24’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5332:36: error: ‘RX_FLAG_40MHZ’ undeclared (first use in this function); did you mean ‘RX_FLAG_8023’?
 5332 |                 rx_status->flag |= RX_FLAG_40MHZ;
      |                                    ^~~~~~~~~~~~~
      |                                    RX_FLAG_8023
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5335:36: error: ‘RX_FLAG_HT’ undeclared (first use in this function)
 5335 |                 rx_status->flag |= RX_FLAG_HT;
      |                                    ^~~~~~~~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_gen1_config_channel’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1155:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
 1155 |                 ht = false;
      |                 ~~~^~~~~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1156:9: note: here
 1156 |         case NL80211_CHAN_WIDTH_20:
      |         ^~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_gen2_config_channel’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1282:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
 1282 |                 ht = false;
      |                 ~~~^~~~~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1283:9: note: here
 1283 |         case NL80211_CHAN_WIDTH_20:
      |         ^~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_set_key’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5685:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
 5685 |                 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
      |                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:5686:9: note: here
 5686 |         default:
      |         ^~~~~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c: In function ‘rtl8xxxu_identify_chip’:
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1750:42: warning: this statement may fall through [-Wimplicit-fallthrough=]
 1750 |                         priv->ep_tx_count++;
      |                         ~~~~~~~~~~~~~~~~~^~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1751:17: note: here
 1751 |                 case 2:
      |                 ^~~~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1753:42: warning: this statement may fall through [-Wimplicit-fallthrough=]
 1753 |                         priv->ep_tx_count++;
      |                         ~~~~~~~~~~~~~~~~~^~
/home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.c:1754:17: note: here
 1754 |                 case 1:
      |                 ^~~~
make[2]: *** [scripts/Makefile.build:277: /home/mi/Desktop/rtl8xxxu/rtl8xxxu_core.o] Error 1
make[1]: *** [Makefile:1868: /home/mi/Desktop/rtl8xxxu] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.15.16-1-MANJARO/build'
make: *** [Makefile:14: modules] Error 2

You also need to check you have firmware at /lib/firmware/rtlwifi/rtl8723bu_nic.bin

You can get the firmware from https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/rtlwifi/rtl8723bu_nic.bin

If this still doesn’t work then there’s something wrong with the driver:

It throw back the same error as before and I notice that rtl8723bu_nic.bin already exist

So it will bring any conflicts?

idk I guess no

GitHub - drygdryg/rtl8188eus: RealTek RTL8188eus WiFi driver with monitor mode & frame injection support use this repository

Did the shared repository worked?