I was able to successfully build the driver for rtl8812au as describe below.
- Get OSMC kernel source
sudo apt-get install rbp2-headers-$(uname -r)
- Create soft link to kernel source
sudo ln -s /usr/src/rbp2-headers-$(uname -r) /lib/modules/$(uname -r)/build
- Clone rtl8812au source code and build
- git clone GitHub - gnab/rtl8812au: Realtek 802.11n WLAN Adapter Linux driver
- modify to enable RPI build as instructed in README
- initiate build using make
- make will fail with below error
osmc@osmc:~/rtl8812au$ make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.55-6-osmc/build M=/home/osmc/rtl8812au modules
make[1]: Entering directory '/usr/src/rbp2-headers-4.19.55-6-osmc'
CC [M] /home/osmc/rtl8812au/core/rtw_cmd.o
In file included from ./include/linux/compat.h:16:0,
from ./include/linux/ethtool.h:17,
from ./include/linux/netdevice.h:41,
from /home/osmc/rtl8812au/include/osdep_service_linux.h:35,
from /home/osmc/rtl8812au/include/osdep_service.h:41,
from /home/osmc/rtl8812au/include/drv_types.h:32,
from /home/osmc/rtl8812au/core/rtw_cmd.c:22:
./include/linux/if.h:28:54: fatal error: sys/socket.h: No such file or directory
#include <sys/socket.h> /* for struct sockaddr. */
^
compilation terminated.
- The reason for above build failure is some issue with socket.h included as part of osmc source files. I followed instructions given in Has anybody tried to install Wireguard? - #25 by rstein to download source from kernel.org and replace few inlcude files
Following are the steps:
- Downloaded source from kernel.org
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.55.tar.xz
tar xf linux-4.19.55.tar.xz
- Delete files in osmc include directory
sudo rm -r /usr/src/rbp2-headers-`uname -r`/include/linux/*
- Copy from kernel.org source
sudo cp -ar linux-4.19.55/include/linux/* /usr/src/rbp2-headers-`uname -r`/include/linux/
- Build rtl8812au driver
make clean
make
sudo ./install.sh
Driver built by above process is working fine.