I have the driver compiled and the wifi adapter functional. It is capable of downloading. I have not yet tested its ability to upload.
NOTE: This problem is not truly solved for the Rock Pi.
I could not compile /usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25/scripts/mod/modpost (see below).
I used the binary from Rock64’s linux-headers.
I had to make two changes to my system.
i. I fixed wrongly compiled scripts (which were binaries not scripts) in kernel headers.
file /usr/src/linux-headers-4.4.194-19-rockchip-g287ff75afc47/scripts/recordmcount
/usr/src/linux-headers-4.4.194-19-rockchip-g287ff75afc47/scripts/recordmcount: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=0610df3dcc846dfea7202b5038911829152c7685, not stripped
I backed up original scripts and compiled each needed one anew.
cd /usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25
cp -a scripts/ scripts-orig_x86-64
cd scripts
I had to compile one at a time after I found which I needed (by attempting to compile 8812au.ko and seeing where cc choked).
mv recordmcount recordmcount-orig_x86-64
make recordmcount
cc recordmcount.c -o recordmcount
cd basic/
mv fixdep fixdep-orig_x86-64
make fixdep
cc fixdep.c -o fixdep
and later, after bypassing an error in compiling,
cd /usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25/scripts
cd mod/
mv modpost modpost-orig_x86-64
make modpost
cc modpost.o -o modpost
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make: *** [: modpost] Error 1
Here, I decided to use Rock64’s modpost
cp -a /home/rock/ROCK64-files_for_Rock_Pi/modpost .
ii. I used gcc-7 to compile to avoid the following error with gcc-8:
/home/rock/realtek-rtl88xxau-5.2.20.2~20180812/hal/rtl8812a/usb/rtl8812au_xmit.c:443:61: warning: bitwise comparison always evaluates to false [-Wtautological-compare]
error, forbidden warning:rtl8812au_xmit.c:443
while ((rtw_read32(adapter, REG_PKTBUF_DBG_CTRL) & BIT23) == 1) {
^~
Originally, gcc-8 was the compiler.
ls -l /usr/bin/gcc*
lrwxrwxrwx 1 root root 5 Feb 25 2019 /usr/bin/gcc -> gcc-8
lrwxrwxrwx 1 root root 23 Apr 6 2019 /usr/bin/gcc-8 -> aarch64-linux-gnu-gcc-8
lrwxrwxrwx 1 root root 8 Feb 25 2019 /usr/bin/gcc-ar -> gcc-ar-8
lrwxrwxrwx 1 root root 26 Apr 6 2019 /usr/bin/gcc-ar-8 -> aarch64-linux-gnu-gcc-ar-8
lrwxrwxrwx 1 root root 8 Feb 25 2019 /usr/bin/gcc-nm -> gcc-nm-8
lrwxrwxrwx 1 root root 26 Apr 6 2019 /usr/bin/gcc-nm-8 -> aarch64-linux-gnu-gcc-nm-8
lrwxrwxrwx 1 root root 12 Feb 25 2019 /usr/bin/gcc-ranlib -> gcc-ranlib-8
lrwxrwxrwx 1 root root 30 Apr 6 2019 /usr/bin/gcc-ranlib-8 -> aarch64-linux-gnu-gcc-ranlib-8
apt install gcc-7
The following NEW packages will be installed:
cpp-7 gcc-7 gcc-7-base libasan4 libgcc-7-dev libubsan0
0 upgraded, 6 newly installed, 0 to remove and 41 not upgraded.
Need to get 15.9 MB of archives.
After this operation, 50.5 MB of additional disk space will be used.
cd /usr/bin/
rm /usr/bin/gcc
ln -s gcc-7 /usr/bin/gcc
rm /usr/bin/gcc-ar
ln -s gcc-ar-7 /usr/bin/gcc-ar
rm /usr/bin/gcc-nm
ln -s gcc-nm-7 /usr/bin/gcc-nm
rm /usr/bin/gcc-ranlib
ln -s gcc-ranlib-7 /usr/bin/gcc-ranlib
ls -l /usr/bin/gcc*
showed gcc-7 in use.
cp -a realtek-rtl88xxau-5.2.20.2~20180812 /usr/src/
dkms add realtek-rtl88xxau/5.2.20.2~20180812
dkms build realtek-rtl88xxau/5.2.20.2~20180812
dkms install realtek-rtl88xxau/5.2.20.2~20180812
After compiling/installing I reverted to gcc-8
cd /usr/bin
rm /usr/bin/gcc
ln -s gcc-8 /usr/bin/gcc
rm /usr/bin/gcc-ar
ln -s gcc-ar-8 /usr/bin/gcc-ar
rm /usr/bin/gcc-nm
ln -s gcc-nm-8 /usr/bin/gcc-nm
rm /usr/bin/gcc-ranlib
ln -s gcc-ranlib-8 /usr/bin/gcc-ranlib
ls -l /usr/bin/gcc*
showed gcc-8 in use.