Fail install Archer T3U

Hi there,

I am failing to install drivers for Archer T3U on my Pi2 running the latest OSMC version.
I have tried to install https://github.com/jeremyb31/rtl8822bu.git without success, as I can’t manage to make the file. Here is what I get

osmc@osmc:~$ git clone https://github.com/jeremyb31/rtl8822bu.git
Cloning into ‘rtl8822bu’…
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 1821 (delta 3), reused 7 (delta 2), pack-reused 1807
Receiving objects: 100% (1821/1821), 7.01 MiB | 745.00 KiB/s, done.
Resolving deltas: 100% (1007/1007), done.
Checking out files: 100% (599/599), done.
osmc@osmc:~$ cd rtl8822bu
osmc@osmc:~/rtl8822bu$ nano Makefile
osmc@osmc:~/rtl8822bu$ make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.14.78-4-osmc/build M=/home/osmc/rtl8822bu modules
make[1]: *** /lib/modules/4.14.78-4-osmc/build: No such file or directory. Stop.
Makefile:2001: recipe for target ‘modules’ failed
make: *** [modules] Error 2

I looked all over the forum and elsewhere without success… And I am a total beginner.

Any help would be much appreciated.

Thanks

You need to install the headers

Sam

While trying to make the file I get the following error:

“rtl8822bu$ make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.14.78-4-osmc/build M=/home/osmc/temp/rtl8822bu modules
make[1]: Entering directory ‘/usr/src/rbp2-headers-4.14.78-4-osmc’
CC [M] /home/osmc/temp/rtl8822bu/core/rtw_cmd.o
In file included from ./include/linux/netfilter.h:8:0,
from ./include/linux/netfilter/nf_conntrack_tuple_common.h:6,
from ./include/linux/netfilter/nf_conntrack_dccp.h:29,
from ./include/net/netns/conntrack.h:11,
from ./include/net/net_namespace.h:27,
from ./include/linux/netdevice.h:42,
from /home/osmc/temp/rtl8822bu/include/osdep_service_linux.h:35,
from /home/osmc/temp/rtl8822bu/include/osdep_service.h:41,
from /home/osmc/temp/rtl8822bu/include/drv_types.h:32,
from /home/osmc/temp/rtl8822bu/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.
scripts/Makefile.build:328: recipe for target ‘/home/osmc/temp/rtl8822bu/core/rtw_cmd.o’ failed
make[2]: *** [/home/osmc/temp/rtl8822bu/core/rtw_cmd.o] Error 1
Makefile:1527: recipe for target ‘module/home/osmc/temp/rtl8822bu’ failed
make[1]: *** [module/home/osmc/temp/rtl8822bu] Error 2
make[1]: Leaving directory ‘/usr/src/rbp2-headers-4.14.78-4-osmc’
Makefile:1318: recipe for target ‘modules’ failed
make: *** [modules] Error 2”

When looking for sys/socket.h: it seems to be in there… So I do not get the reason of the error.
Any thoughts? I tried different version of the driver without success. Same error everytime.

It looks like the OSMC headers are still broken.

I see you figured out the need to add the “build” symbolic link. Well done.

There is a workaround detailed here. You’ll also need to download the kernel source.

Edit:

Just tried the workaround. Success!

make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.14.78-4-osmc/build M=/home/osmc/rtl8822bu modules
make[1]: Entering directory '/usr/src/rbp2-headers-4.14.78-4-osmc'
  <snip>
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M]  /home/osmc/rtl8822bu/8822bu.ko
make[1]: Leaving directory '/usr/src/rbp2-headers-4.14.78-4-osmc'

This needs patching in make-kpkg – but I’m not sure why only arm is affected.

As I detailed here, it looked to me like an error in the use of make headers-install that was incorrectly modifying the uAPI headers.

I will look in to this tomorrow. Thanks for the link and digging.

Many thanks to you both!
The workaround seemed to work, however I still have an error to make the driver…

make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.14.78-4-osmc/build M=/home/osmc/rtl8822bu modules
make[1]: Entering directory ‘/usr/src/rbp2-headers-4.14.78-4-osmc’
CC [M] /home/osmc/rtl8822bu/core/rtw_cmd.o
Segmentation fault
scripts/Makefile.build:328: recipe for target ‘/home/osmc/rtl8822bu/core/rtw_cmd.o’ failed
make[2]: *** [/home/osmc/rtl8822bu/core/rtw_cmd.o] Error 139
Makefile:1527: recipe for target ‘module/home/osmc/rtl8822bu’ failed
make[1]: *** [module/home/osmc/rtl8822bu] Error 2
make[1]: Leaving directory ‘/usr/src/rbp2-headers-4.14.78-4-osmc’
Makefile:2001: recipe for target ‘modules’ failed
make: *** [modules] Error 2

Any idea?

Nope. It built just fine on my Pi3. Switch off Kodi and see if that helps.

If all alse fails, I could always upload the module to a file-sharing site.

I tried through sudo systemctl stop mediacenter, but it changes nothing. Same error.

You can download it from https://volafile.org/r/11w5gkn8c The file will be available for two days.

Copy it into /home/osmc/rtl8822bu and then run sudo make install.

I don’t have the T3U so haven’t tested it.

Thank you @dillthedog!

It seems that 88x2bu.ko is missing…

osmc@osmc:~/rtl8822bu$ sudo make install
install -p -m 644 88x2bu.ko /lib/modules/4.14.78-4-osmc/kernel/drivers/net/wireless/
install: cannot stat ‘88x2bu.ko’: No such file or directory
Makefile:2007: recipe for target ‘install’ failed
make: *** [install] Error 1

osmc@osmc:~/rtl8822bu$ ls -l *.ko
-rw-r--r-- 1 osmc osmc 2513328 Oct 12 18:54 8822bu.ko
osmc@osmc:~/rtl8822bu$ sudo make install
install -p -m 644 8822bu.ko  /lib/modules/4.14.78-4-osmc/kernel/drivers/net/wireless/
/sbin/depmod -a 4.14.78-4-osmc

You’ve might have messed up the Makefile. Did you follow the instruction:

If installing on Rasberry Pi or other “armv71” devices, edit the Makefile and set CONFIG_PLATFORM_ARM_RPI = y and CONFIG_PLATFORM_I386_PC = n

Yes I did… checked again, it seems correct.

Here’s the MD5 of my Makefile:

osmc@osmc:~/rtl8822bu$ md5sum Makefile
f69922ac6f75e270b7855235d219683a  Makefile

I don’t think I’ve changed anything other than the platform flags.

Edit: On second thoughts, just run the commands:

sudo cp 8822bu.ko /lib/modules/4.14.78-4-osmc/kernel/drivers/net/wireless/
sudo depmod -a 4.14.78-4-osmc

Thanks! It worked.

Now the issue I have is that Kodi do not start anymore with the sad smiley.
I tried to do reinstall the mediacenter but it still does not start. Here is what I get when checking status:

  • mediacenter.service - media center application
    Loaded: loaded (/lib/systemd/system/mediacenter.service; enabled; vendor preset: enabled)
    Active: active (running) since Sun 2019-10-13 20:03:01 CEST; 3min 41s ago
    Main PID: 246 (mediacenter)
    CGroup: /system.slice/mediacenter.service
    `-246 /bin/bash /usr/bin/mediacenter

Oct 13 20:06:19 osmc sudo[918]: pam_unix(sudo:session): session opened for user osmc by (uid=0)
Oct 13 20:06:21 osmc sudo[918]: pam_unix(sudo:session): session closed for user osmc
Oct 13 20:06:21 osmc mediacenter[246]: /usr/bin/mediacenter: line 142: 918 Illegal instruction sudo -u osmc LIRC_SOCKET_PATH=/var/run/lirc/lircd $KODI --standalone -fs
Oct 13 20:06:21 osmc mediacenter[246]: Kodi exited with return code 132 after 0 hours, 0 minutes and 2 seconds
Oct 13 20:06:33 osmc mediacenter[246]: Starting Kodi…
Oct 13 20:06:33 osmc sudo[934]: root : TTY=unknown ; PWD=/ ; USER=osmc ; ENV=LIRC_SOCKET_PATH=/var/run/lirc/lircd ; COMMAND=/usr/lib/kodi/kodi.bin --standalone -fs
Oct 13 20:06:33 osmc sudo[934]: pam_unix(sudo:session): session opened for user osmc by (uid=0)
Oct 13 20:06:36 osmc sudo[934]: pam_unix(sudo:session): session closed for user osmc
Oct 13 20:06:36 osmc mediacenter[246]: /usr/bin/mediacenter: line 142: 934 Illegal instruction sudo -u osmc LIRC_SOCKET_PATH=/var/run/lirc/lircd $KODI --standalone -fs
Oct 13 20:06:36 osmc mediacenter[246]: Kodi exited with return code 132 after 0 hours, 0 minutes and 3 seconds

With so many strange errors happening, I’m inclined to think that the SD card might have become corrupted.

So the best way to go is to format and restart?

Yes. Ideally, you’d use a new card, since it might be a problem with the card itself.