Manjaro arm on Amlogic Tv box?

thanks that did the trick, but now I’m getting this error
make
/bin/sh: linha 1: bc: comando não encontrado
make ARCH=aarch64 CROSS_COMPILE= -C /lib/modules/5.10.5-1-MANJARO-ARM/build M=/home/pedro/RTL8822CS modules
make[1]: a entrar na pasta “/usr/lib/modules/5.10.5-1-MANJARO-ARM/build”

Makefile:681: arch/aarch64/Makefile: Ficheiro ou pasta inexistente
make[1]: *** Sem regra para fazer o alvo “arch/aarch64/Makefile”. Parar.
make[1]: a sair da pasta “/usr/lib/modules/5.10.5-1-MANJARO-ARM/build”
make: *** [Makefile:2296: modules] Erro 2

Great news.

Is this for x96 max+ ?
Which DTB are you using?

Can you save the layout in notpad as txt ?

Want to test this on my x96max+

Looks like bc is not found.

sudo pacman -S base-devel

and maybe also

sudo pacman -S bc

1 Like

no luck

[pedro@sala RTL8822CS]$ make
make ARCH=aarch64 CROSS_COMPILE= -C /lib/modules/5.10.5-1-MANJARO-ARM/build M=/home/pedro/RTL8822CS modules
make[1]: a entrar na pasta “/usr/lib/modules/5.10.5-1-MANJARO-ARM/build”
Makefile:681: arch/aarch64/Makefile: Ficheiro ou pasta inexistente
make[1]: *** Sem regra para fazer o alvo “arch/aarch64/Makefile”. Parar.
make[1]: a sair da pasta “/usr/lib/modules/5.10.5-1-MANJARO-ARM/build”
make: *** [Makefile:2296: modules] Erro 2

I’m not sure if the sed commands worked for you correctly. Therefore, please open the Makefile with an editor, go to line 2296 and see if it shows this:

$(MAKE) -j4 -C $(KSRC) M=$(shell pwd) modules

and line 2299 should look like this:

strip $(MODULE_NAME).ko --strip-unneeded

Hi,
I am using meson-sm1-x96maxplus-vim.dtb which you can download here http://ge.tt/5NhfGaA3

What do you mean by ‘layout’?

Thanks for the DTB file.

Often when copy past to forum txt can change

Can y make a txt file or script sh file and upload with all the commands.

Sorry for your trouble, but I only have 1955 lines in my Makefile
I can’t find
$(MAKE) -j4 -C $(KSRC) M=$(shell pwd) modules
or
strip $(MODULE_NAME).ko --strip-unneeded
anywhere in my Makefile

Delete RTL8822CS folder and start over again.

I have changed formatting of the howto some minutes ago. Now you should be able to copy and paste.

same error occurred

gausus@x96 ~]$ cd RTL8822CS/
[gausus@x96 RTL8822CS]$ sed -i ‘s/$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules/$(MAKE) -j4 -C $(KSRC) M=$(shell pwd) modules/g’ Makefile
[gausus@x96 RTL8822CS]$ sed -i ‘s/$(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded/strip $(MODULE_NAME).ko --strip-unneeded/g’ Makefile
[gausus@x96 RTL8822CS]$ make
make ARCH=aarch64 CROSS_COMPILE= -C /lib/modules/5.10.5-1-MANJARO-ARM/build M=/home/gausus/RTL8822CS modules
make[1]: Entering directory ‘/usr/lib/modules/5.10.5-1-MANJARO-ARM/build’
Makefile:681: arch/aarch64/Makefile: No such file or directory
make[1]: *** No rule to make target ‘arch/aarch64/Makefile’. Stop.
make[1]: Leaving directory ‘/usr/lib/modules/5.10.5-1-MANJARO-ARM/build’
make: *** [Makefile:2296: modules] Error 2

Sed not working for line 2296
Had to change line 2296 manually in Makefile

By manually editing Makefile line 2296
$(MAKE) -j4 -C $(KSRC) M=$(shell pwd) modules
manage to compile it, and successfully copied the 88x2cs.ko but got a final error
[pedro@sala rtl88x2cs]$ sudo modprobe 88x2cs
[sudo] senha para pedro:
modprobe: FATAL: Module 88x2cs not found in directory /lib/modules/5.10.5-1-MANJARO-ARM

I had the same error this morning. Then I copied the .ko to /lib/modules/5.10.5-1-MANJARO-ARM, but it still did not work. I also gzipped the .ko and copied it there. But no success and I gave up and turned the box off.
Some time later I turned it on again and tried sudo modprobe 88x2cs and it worked …
Maybe the restart was needed? I am not sure. I also think that I wrote sudo modprobe 88x2cs.ko in the morning which seems to be wrong (.ko at the end.)

So, maybe you reboot and try again?!?

I am off to bed now …

I managed to get my internal wifi work again. So sudo modprobe 88x2cs worked now. Seems to be connected with DKMS.
I need to check how to do it with a clean install of Manjaro to make the procedure reproducible for you girls and guys.

Please be patient (I am not sure when I will find some time to work on this again).

2 Likes

Hi @TheMojoMan: A tutorial on how to compile the wifi driver for x96 Max+ would be awesome. Many Thanks

I see that you just compiled it the same way. This can be pkged using the PKGBUILD and arm.patch and it will build after every kernel update.

Feel free to consult me I can try to build it using the explanation you shared.

Unfortunately, it does not work the way I described above. It only worked for me because I was doing several tests before with dkms. But I can reproduce the steps now to get it working (did it with a new image). See below …

SEE POST#648 BELOW FOR AN EASIER METHOD

Howto: Compile and activate RTL8822CS wifi driver (for X96Max+, X96Air, rev 2?)

  • Download rtl8822cs-dkms-git package from here http://ge.tt/7XzObYA3
  • Decrompress it to a folder of your choice
  • Open a terminal and cd into that folder
  • When you type ls you should see three files: arch.patch, dkms.conf and PKGBUILD
  • Type sudo pacman -S base-devel linux-vim-headers dkms bc git to install the needed dependencies
  • Now type makepkg -i and wait …

Unfortunately, there is still an error and therefore some extra work has to be done:

  • Type cd src/rtl8822cs/
  • Type make and wait for about 5 min. The driver should be compiled.
  • Type sudo cp 88x2cs.ko /lib/modules/$(uname -r)
  • Type cd ../..
  • Type makepkg -i once more
  • Finally, type sudo modprobe 88x2cs. If you do not get an error everything should be fine.

Not elegant but this is how it worked for me (I tried this procedure with a brand new Manjaro image). I hope it will also work for you.
Currently you still have to repeat that procedure when you upgrade to a new kernel. But once the error in the package is found the compilation by hand is not needed anymore and kernel updates should be no problem (hopefully).

@spikerguy Thank you for your invaluable help and support! Maybe you can have another look into the source.

When I insert MAKE[0]=“make” into dkms.conf I get:

...
(2/2) Install DKMS modules
==> dkms install --no-depmod -m rtl8822cs -v 0.1 -k 5.10.5-1-MANJARO-ARM
Error! Bad return status for module build on kernel: 5.10.5-1-MANJARO-ARM (aarch64)
[themojoman@X96MaxPlus rtl8822cs-dkms-git]$ cat /var/lib/dkms/rtl8822cs/0.1/build/make.log 
DKMS make.log for rtl8822cs-0.1 for kernel 5.10.5-1-MANJARO-ARM (aarch64)
Mon Jan 25 04:56:47 PM CET 2021
make: *** No targets.  Stop.

When I set it to MAKE[0]="" I get:

...
(2/2) Install DKMS modules
==> dkms install --no-depmod -m rtl8822cs -v 0.1 -k 5.10.5-1-MANJARO-ARM
Error!  Build of 88x2cs.ko failed for: 5.10.5-1-MANJARO-ARM (aarch64)
Make sure the name of the generated module is correct and at the root of the
build directory, ...
[themojoman@X96MaxPlus rtl8822cs]$ cat /var/lib/dkms/rtl8822cs/0.1/build/make.log 
DKMS make.log for rtl8822cs-0.1 for kernel 5.10.5-1-MANJARO-ARM (aarch64)
Mon Jan 25 03:59:07 PM CET 2021
make: Entering directory '/usr/lib/modules/5.10.5-1-MANJARO-ARM/build'
  MODPOST /var/lib/dkms/rtl8822cs/0.1/build/Module.symvers
make: Leaving directory '/usr/lib/modules/5.10.5-1-MANJARO-ARM/build'

Extra service:
So, I deleted my sd card and installed a fresh Manjaro image once more and following above procedure I was able to successfully activate my internal wifi again. :grin:

3 Likes

Great work. Many thanks for your tutorial @TheMojoMan
I can confirm that I was able to build and install the driver :grinning:

Great to hear that! Makes me :smiley: