Hi,
I’m trying to compile wifi drivers for RTL8812AU usb wifi. Compilation works on rasbpian and other distribution, but compilation on OSMC does not work. There is an error. Maybe you can help, because there is something different in OSMC.
Here are some information about hardware:
root@osmc:/usr/src/8814au# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac 2T2R DB WLAN Adapter
root@osmc:~# uname -a
Linux osmc 5.10.78-5-osmc SMP PREEMPT Mon Feb 28 01:18:12 UTC 2022 aarch64 GNU/Linux
I’ve found, drivers to my adapter is here: GitHub - morrownr/8812au-20210629: Linux Driver for USB WiFi Adapters that are based on the RTL8812AU Chipset - v5.13.6
At first, I tried to install rbp2-headers.
apt install rbp2-headers-5.10.78-5-osmc
Compilation worked, but when I was trying to insert module, I had this error:
modprobe: ERROR: could not insert '8812au': Exec format error
I think, the main reason is, that rbp2-headers package is not for Raspberry 4.
So I tried to install these packages:
apt install rbp464-headers-5.10.78-5-osmc
apt install rbp464-headers-sanitised-5.10.78-5-osmc
But I have error during the compilation:
root@osmc:~/src/8812au-20210629# ./ARM_RPI.sh
I386 support was turned off in Makefile as planned.
Raspberry Pi OS (32 bit) support was turned on in Makefile as planned.
root@osmc:~/src/8812au-20210629# ./install-driver.sh
Running install-driver.sh version 20220108
Open Source Media Center
5.10.78-5-osmc
aarch64
Starting installation...
Copying source files to: /usr/src/rtl8812au-5.13.6
Copying 8812au.conf to: /etc/modprobe.d
Creating symlink /var/lib/dkms/rtl8812au/5.13.6/source ->
/usr/src/rtl8812au-5.13.6
DKMS: add completed.
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
'make' -j4 KVER=5.10.78-5-osmc KSRC=/lib/modules/5.10.78-5-osmc/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.78-5-osmc (aarch64)
Consult /var/lib/dkms/rtl8812au/5.13.6/build/make.log for more information.
An error occurred. dkms build error = 10
Please report this error.
You will need to run the following before reattempting installation.
$ sudo ./remove-driver.sh
root@osmc:~/src/8812au-20210629# cat /var/lib/dkms/rtl8812au/5.13.6/build/make.log
DKMS make.log for rtl8812au-5.13.6 for kernel 5.10.78-5-osmc (aarch64)
Po čen 13 23:50:19 CEST 2022
make ARCH=arm CROSS_COMPILE= -C /lib/modules/5.10.78-5-osmc/build M=/var/lib/dkms/rtl8812au/5.13.6/build modules
make[1]: Vstupuje se do adresáře „/usr/src/rbp464-headers-5.10.78-5-osmc“
CC [M] /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_cmd.o
CC [M] /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_security.o
CC [M] /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_debug.o
CC [M] /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_io.o
In file included from ./include/asm-generic/int-ll64.h:11,
from ./arch/arm/include/uapi/asm/types.h:5,
from ./include/uapi/linux/types.h:5,
from ./include/linux/types.h:6,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/basic_types.h:75,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/drv_types.h:26,
from /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_security.c:17:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: Adresář nebo soubor neexistuje
#include <asm/bitsperlong.h>
^~~~~~~~~~~~~~~~~~~
In file included from ./include/asm-generic/int-ll64.h:11,
from ./arch/arm/include/uapi/asm/types.h:5,
from ./include/uapi/linux/types.h:5,
from ./include/linux/types.h:6,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/basic_types.h:75,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/drv_types.h:26,
from /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_cmd.c:17:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: Adresář nebo soubor neexistuje
#include <asm/bitsperlong.h>
^~~~~~~~~~~~~~~~~~~
In file included from ./include/asm-generic/int-ll64.h:11,
from ./arch/arm/include/uapi/asm/types.h:5,
from ./include/uapi/linux/types.h:5,
from ./include/linux/types.h:6,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/basic_types.h:75,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/drv_types.h:26,
from /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_io.c:47:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: Adresář nebo soubor neexistuje
#include <asm/bitsperlong.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from ./include/asm-generic/int-ll64.h:11,
from ./arch/arm/include/uapi/asm/types.h:5,
from ./include/uapi/linux/types.h:5,
from ./include/linux/types.h:6,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/basic_types.h:75,
from /var/lib/dkms/rtl8812au/5.13.6/build/include/drv_types.h:26,
from /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_debug.c:17:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: Adresář nebo soubor neexistuje
#include <asm/bitsperlong.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
compilation terminated.
make[2]: *** [scripts/Makefile.build:280: /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_io.o] Chyba 1
make[2]: *** Čeká se na nedokončené úlohy…
make[2]: *** [scripts/Makefile.build:280: /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_debug.o] Chyba 1
make[2]: *** [scripts/Makefile.build:280: /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_security.o] Chyba 1
make[2]: *** [scripts/Makefile.build:280: /var/lib/dkms/rtl8812au/5.13.6/build/core/rtw_cmd.o] Chyba 1
make[1]: *** [Makefile:1825: /var/lib/dkms/rtl8812au/5.13.6/build] Chyba 2
make[1]: Opouští se adresář „/usr/src/rbp464-headers-5.10.78-5-osmc“
make: *** [Makefile:2514: modules] Chyba 2
It looks like, that it is not possible to find asm/bitsperlong.h:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: Adresář nebo soubor neexistuje
#include <asm/bitsperlong.h>
^~~~~~~~~~~~~~~~~~~
And I don’t understand, how to solve it. Compilation works on other raspberry pi distributions.
But other distributions have only one kernel headers package.
Do I have installed right kernel headers?
root@osmc:/lib/modules/5.10.78-5-osmc# ls -l
celkem 2352
lrwxrwxrwx 1 root root 38 úno 28 03:09 build -> /usr/src/rbp464-headers-5.10.78-5-osmc
root@osmc:/lib/modules/5.10.78-5-osmc# ls -l /usr/src/
celkem 12
drwxr-xr-x 3 root root 4096 čen 13 23:09 rbp464-headers-sanitised-5.10.78-5-osmc
drwxr-xr-x 23 root root 4096 čen 13 23:11 rbp464-headers-5.10.78-5-osmc
root@osmc:/usr/src/rbp464-headers-sanitised-5.10.78-5-osmc# ls -l
celkem 4
drwxr-xr-x 13 root root 4096 čen 13 23:09 include
root@osmc:/usr/src/rbp464-headers-sanitised-5.10.78-5-osmc# ls -l include/
celkem 68
drwxr-xr-x 2 root root 4096 čen 13 23:09 asm
drwxr-xr-x 2 root root 4096 čen 13 23:09 asm-generic
drwxr-xr-x 2 root root 4096 čen 13 23:09 drm
drwxr-xr-x 28 root root 24576 čen 13 23:09 linux
drwxr-xr-x 3 root root 4096 čen 13 23:09 misc
drwxr-xr-x 2 root root 4096 čen 13 23:09 mtd
drwxr-xr-x 3 root root 4096 čen 13 23:09 rdma
drwxr-xr-x 3 root root 4096 čen 13 23:09 scsi
drwxr-xr-x 3 root root 4096 čen 13 23:09 sound
drwxr-xr-x 2 root root 4096 čen 13 23:09 video
drwxr-xr-x 2 root root 4096 čen 13 23:09 xen
This is not only about RTL8812AU drivers. I tried to compile different drivers and I had the same problem with fatal error during compilation.