Archlinux on Rock5b

You are the best

I have an all external library version of kodi here:

AUR (en) - kodi-ext-git (archlinux.org)

Since ffmpeg is updated, it should already use the new version…

thats a good idea, currently the master of kodi branch has updated with ffmpeg 6 support, which is the system ffmpeg version of Arch. So it should work until it does not, kodi can be picky about ffmpeg versions.

2nd reason is to inputstream.ffmpegdirect binary addon also depends on ffmpeg, either it also needs to be configured to be using system ffmpeg, or internal ffmpeg of it also needs to be patched.

last reason i have to have those packages is to hop in between branches, i am also developing some addons and sometimes i need to hop between versions, and i most of the time use ffmpegdirect addon.

Feel free to add/change something in the package, I’ve add you as co-maintainer.

1 Like

I actually started writing a script to install archlinux few months ago, but I dont have my rock 5b with me a while until this month, I just get back to work with it and updated it. So I decided to share it :

To get started, just run this on your Rock 5B (or any Linux system with your rock 5b boot drive plugged in) :

bash <(curl -fsSL https://raw.githubusercontent.com/kwankiu/archlinux-installer-rock5/main/archlinux-installer)

The github repo :
https://github.com/kwankiu/archlinux-installer-rock5

1 Like

ah thank you :), i am adding the link to the first post to prevent it getting lost in the forum history.
Or i remember there is some place like a wiki for rock5 now, may be we can also use it.

1 Like

it is there, are you sure you are booting from the same kernel the package brings? you can verify this by uname -a and your config in extlinux.conf

Version Structure is:
kernelmaj.kernelmin.patchver-totalcommitnum-hashofkernel-hashofoverlays-radxa-rkbsp

in my case below

5.10.160-1080577-fc20e0bcd284-2bb2564-radxa-rkbsp

means that it has been compiled with
https://github.com/radxa/kernel/tree/fc20e0bcd284

[alarm@alarm ~]$ ls /usr/lib/modules/ 
5.10.160-1080577-fc20e0bcd284-2bb2564-radxa-rkbsp
[alarm@alarm ~]$ uname -a
Linux alarm 5.10.160-1080577-fc20e0bcd284-2bb2564-radxa-rkbsp #1 SMP Mon Jul 31 17:39:37 UTC 2023 aarch64 GNU/Linux
[alarm@alarm ~]$ pacman -Q | grep linux-radxa
linux-radxa-rkbsp5-git 5.10.1080577.fc20e0bcd284.2bb2564-1
linux-radxa-rkbsp5-git-headers 5.10.1080577.fc20e0bcd284.2bb2564-1
[alarm@alarm ~]$ modprobe r8125
[alarm@alarm ~]$ lsmod | grep r8125
r8125                 135168  0

My script aims to have the Arch Linux installation completed before actually booting to the system. So that I compiled and uploaded the files for the script to copy to the boot partition.

I checked the PKGBUILD from your AUR and I just looked up the necessary files to copy to. I will update the script soon.

Meanwhile, I am also writing a script for “first boot”. I will also look into a better way of gathering the kernel files, and probably play around with the midstream kernel too.

Since it is a script that aims to run on different linux system (Debian, Ubuntu, Arch, etc), I can’t think of a better way to have a kernel maintained by pacman out-of-the-box. In that case, we have a working copy of archlinux installed, but the kernel is not maintained by Arch. Therefore will not update. We can install / re-install the kernel using the AUR after the first boot, but this can take some time. Meanwhile, linux-radxa-rkbsp5-bin is still 5.10.110 on branch rkr3.4, while linux-radxa-rkbsp5-git could takes more than 3 hours.

I would suggest use -bin package by default because it is what officially radxa has, if someone needs an updated version, then he needs to compile.

Since there is no official binary distribution of packages, no-one else will compile those packages for them. Same goes for the rest of the packages as well.

1 Like

I just added two more scripts install-kernel.sh and post-install.sh. They will be automatically stored in /home/YOUR_USER/tools after running firstbootsetup.sh.

The install kernel script will help you on installing/re-installing the kernel (you can choose from rkbsp5-bin rkbsp5-git and midstream)

The post install script is still WIP.

Both script has not yet been tested.

1 Like

Installed midstream and pancsf

But gpu doesnt seems to be working, gnome shows software rendering and it is laggy.

Ethernet is working but the network setting tab is empty, and WiFi doesnt seems to have a driver. (no Wifi and Bluetooth)

i remember i made it work, but dont really remember how, may be it needs the firmware in /usr/lib, when you remove rkbsp kernels the firmware s also go away with them.

When you make it work, make sure you set the governor of gpu to performance, otherwise you will see glitches in the screen.

I guess there’s nothing to do with /usr/lib/firmware/mali_csffw.bin. I tried both having it and removing it. dmesg shows the same.

pancsf fb000000.gpu: Direct firmware load for mali_csffw.bin failed with error -2
pancsf fb000000.gpu: Failed to load firmware image ‘mali_csffw.bin’

From this forum, it looks like we need a dtb.

@boogiepop did you actually copied a dtb from the rkbsp?

this firmware seems to load:
https://github.com/JeffyCN/mirrors/raw/488f49467f5b4adb8ae944221698e9a4f9acb0ed/firmware/g610/mali_csffw.bin

however vop2_mmu shits its pants

[    5.725407] rk_iommu fdd97e00.iommu: Page fault at 0x0000000000800000 of type read
[    5.725427] rk_iommu fdd97e00.iommu: iova = 0x0000000000800000: dte_index: 0x2 pte_index: 0x0 page_offset: 0x0
[    5.725436] rk_iommu fdd97e00.iommu: mmu_dte_addr: 0x0000000006131000 dte@0x0000000006131008: 0x138d6001 valid: 1 pte@0x00000000138d6000: 0x14072007 valid: 1 page@0x0000000014072000 flags: 0x6

it is most likely this new commit, if you revert this one it should work.

or simply set this to “disabled”

you can even do this with dtc binary, by first decompiling the active dtb to dts, changing vop2mmu to disabled, and compile back to dtb…

@kwankiu

here is a compiled dtb for you to test, if still does not work, try adding cma=256M to the kernel command line extlinux

rock5b_dtb_novop2mmu.zip (34.7 KB)

Using your dtb, I need to add cma=256M to get display output, but it still shows the same error, and it is still using Software Rendering. Without cma=256M, it doesnt have display output.

(I am using a 4K monitor, idk whether it works on 1080P or not, but I dont have a 1080P or lower monitor with me)

I have tried the armbian midstream image from monka before, and i remember it worked. Maybe I will look into it

I looked up the armbian image. I tried replacing the dtb, replacing mali_csffw.bin, replacing the pancsf.ko, I also tried reinstalling the mesa-pancsf-git, but I am out of luck. rk_iommu doesn’t logs an error so I assume it works.

One bonus is that using monka’s armbian image’s dtb enables pwm fan support.

[rock@alarm ~]$ dmesg | grep pancsf
[    2.433507] pancsf fb000000.gpu: clock rate = 198000000
[    2.433518] pancsf fb000000.gpu: bus_clock rate = 200000000
[    2.433527] pancsf fb000000.gpu: [drm:pancsf_devfreq_init [pancsf]] More than 1 supply is not supported yet
[    2.445455] pancsf fb000000.gpu: [drm:pancsf_devfreq_init [pancsf]] Failed to register cooling device
[    2.445494] pancsf fb000000.gpu: mali-g610 id 0xa867 major 0x0 minor 0x0 status 0x5
[    2.445497] pancsf fb000000.gpu: Features: L2:0x07120306 Tiler:0x00000809 Mem:0x301 MMU:0x00002830 AS:0xff
[    2.445500] pancsf fb000000.gpu: shader_present=0x50005 l2_present=0x1 tiler_present=0x1
[    2.448921] pancsf fb000000.gpu: Direct firmware load for mali_csffw.bin failed with error -2
[    2.448934] pancsf fb000000.gpu: Failed to load firmware image 'mali_csffw.bin'
[    2.449091] pancsf fb000000.gpu: Fatal error during GPU init
[    2.449184] pancsf: probe of fb000000.gpu failed with error -2
[rock@alarm ~]$ dmesg | grep iommu 
[    0.130685] iommu: Default domain type: Translated 
[    0.130688] iommu: DMA domain TLB invalidation policy: strict mode 
[    2.445002] rockchip-vop2 fdd90000.vop: Adding to iommu group 0

Update :
I hooked up the Armbian image.

Would you be able to upload an image that has pancsf working so I can test and sees what happens?

Also, when i compile ffmpeg-mpp from AUR, it saids missing librist and onevpl, but the librist package on AUR saids it is not available for the ‘aarch64’ architecture.

Hello, i dont have access to sbc now and my rootfs is around 200gb at the moment. It will take quite some time to clean it.

Dont mind about ‘not available for aarch64’ warnings because they are source pkgs, it does not matter for which architecture they are