Kernel Headers for Driver Install

I’m away from home this weekend, so won’t have a lot of free time to help out. Nevertheless, I VPN-ed back to base and tried to compile the code you linked to. It fails, but in a totally different way:

osmc@osmc:~/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959$ make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.55-6-osmc/build M=/home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959  modules
make[1]: Entering directory '/usr/src/rbp2-headers-4.19.55-6-osmc'
  CC [M]  /home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/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/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/include/osdep_service_linux.h:30,
                 from /home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/include/osdep_service.h:50,
                 from /home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/include/drv_types.h:27,
                 from /home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/core/rtw_cmd.c:17:
./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.
scripts/Makefile.build:303: recipe for target '/home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/core/rtw_cmd.o' failed
make[2]: *** [/home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959/core/rtw_cmd.o] Error 1
Makefile:1517: recipe for target '_module_/home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959' failed
make[1]: *** [_module_/home/osmc/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959] Error 2
make[1]: Leaving directory '/usr/src/rbp2-headers-4.19.55-6-osmc'
Makefile:2011: recipe for target 'modules' failed
make: *** [modules] Error 2
osmc@osmc:~/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959$ uname -a
Linux osmc 4.19.55-6-osmc #1 SMP PREEMPT Sun Nov 3 22:15:28 UTC 2019 armv7l GNU/Linux
osmc@osmc:~/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959$ dpkg -l "rbp2-headers*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                 Version                 Architecture            Description
+++-====================================-=======================-=======================-=============================================================================
un  rbp2-headers                         <none>                  <none>                  (no description available)
un  rbp2-headers-4.19                    <none>                  <none>                  (no description available)
ii  rbp2-headers-4.19.55-6-osmc          6                       armhf                   Header files related to Linux kernel, specifically,
osmc@osmc:~/Downloads/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959$ 

This sys/socket.h: No such file or directory is a familiar error. See Has anybody tried to install Wireguard? - #9 by graza and the posts that follow.

Can you think of any reason why you’re seeing something completely different?