Archlinux on Rock5b

Logs :

[rock@alarm ~]$ /usr/lib/bluetooth/bluetoothd -n -d
bluetoothd[2343]: Bluetooth daemon 5.68
bluetoothd[2343]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf
D-Bus setup failed: Connection ":1.86" is not allowed to own the service "org.bluez" due to security policies in the configuration file
bluetoothd[2343]: src/main.c:main() Unable to get on D-Bus
[rock@alarm ~]$ lsmod | grep blue
bluetooth             471040  14 btqca,btintel,hci_uart,btbcm,bnep,rtk_btusb
ecdh_generic           16384  1 bluetooth
[rock@alarm ~]$ dmesg | grep blue
[    7.734516] hci_uart_bcm serial0-0: Looking up vddio-supply property in node /serial@feb90000/bluetooth failed
[   12.324658] Modules linked in: bnep hci_uart btqca btbcm btintel 8852be rtkm r8125 rtk_btusb bluetooth ecdh_generic ecc apple_mfi_fastcharge sch_fq_codel dm_multipath fuse dm_mod ip_tables x_tables ipv6
[rock@alarm ~]$ systemctl status bluetooth
* bluetooth.service - Bluetooth service
     Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; preset: disabled)
     Active: active (running) since Thu 2023-08-17 16:42:45 UTC; 9min ago
       Docs: man:bluetoothd(8)
   Main PID: 483 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 8906)
     Memory: 3.0M
        CPU: 50ms
     CGroup: /system.slice/bluetooth.service
             `-483 /usr/lib/bluetooth/bluetoothd

Aug 17 16:42:45 alarm systemd[1]: Starting Bluetooth service...
Aug 17 16:42:45 alarm bluetoothd[483]: Bluetooth daemon 5.68
Aug 17 16:42:45 alarm systemd[1]: Started Bluetooth service.
Aug 17 16:42:45 alarm bluetoothd[483]: Starting SDP server
Aug 17 16:42:45 alarm bluetoothd[483]: src/plugin.c:plugin_init() System does not support csip plugin
Aug 17 16:42:45 alarm bluetoothd[483]: src/plugin.c:plugin_init() System does not support vcp plugin
Aug 17 16:42:45 alarm bluetoothd[483]: src/plugin.c:plugin_init() System does not support mcp plugin
Aug 17 16:42:45 alarm bluetoothd[483]: src/plugin.c:plugin_init() System does not support bass plugin
Aug 17 16:42:45 alarm bluetoothd[483]: src/plugin.c:plugin_init() System does not support bap plugin
Aug 17 16:42:45 alarm bluetoothd[483]: Bluetooth management interface 1.18 initialized

I have just released a new update for the installation script.

  • The installation script should now works on WSL (Ubuntu/Debian) with the ability to mount a disk (Tips: start WSL as admin).

  • I have created a tool called arch-rock-config (Arch Rock Configuration Utility) with the following features available :

Tips : You can also install arch-rock-config even if you do not use my installation script, you can do so by running :

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

I am also trying to add malior-droid, steam, wine, etc.

However,
for malior-droid, it seems binder is missing in kernel.
for steam, wine, etc, box86 is required but it is only available on armhf, not on alarm aarch64.

Appreciate if anybody could help with this, feedback and PR are also welcomed.

TL;DR for features below: The fan-control is currently using the package method (not dtb). It works great. You can also change SoC performance mode, check temps, clock speed, etc. You can change kernel, bootloader, etc. You can easily downgrade any pacman available packages, and I also added some common packages for ease of installation (browser, office, discord, teams, vscode, box64, and many more.), arch-rock-config install can also be used to install any packages from pacman and AUR.

Features

System Maintenance

Features Description
upgrade Check & Perform Selective / Full System Upgrade.
install-kernel Re-install / Replace Linux Kernel. kernel options: rkbsp, rkbsp-git, midstream.
flash-bootloader Flash Latest SPI Bootloader. bootloader options: radxa, radxa-debug, edk2-rock5a, edk2-rock5b, armbian.

Manage Packages

Features Description
install Package Manager (Install only), Includes RK3588 Specified and Customized Packages. You can use it like: arch-rock-config install chromium neofetch git
downgrade Install / Downgrade any Arch Linux ARM Packages from Archive (alaa). You can use it like: arch-rock-config downgrade chromium. By default only 15 archives shown, you may optionally add <index> to show more/less.

Performance & Features

Features Description
soc Manage SoC Settings. options: performance, ondemand, powersave (and status for SoC Monitor).
fan Configure PWM Fan-control. options: install, enable, disable and status.

User & Localization

Features Description
user Add, Remove and Change User Account Settings.
locale Generate Locale Settings.
font Install Fonts, TTF, Non-English Characters, Special Characters / Emoji.
time Change Time Zone, Current Date and Time.
keyboard Change Keyboard Layout.
wifi Change WiFi Country Settings.

I have also compiled and provided a Custom Chromium. However, I am not sure how it works and how to verify if chrome is using the v4l2-mpp or not.

I would suggest to have a look at https://github.com/7Ji/archrepo which is a binary repo of mostly available AUR libs for rockchip. It was meant for opi5 but works for rock 5 as well. There they have chromium-mpp with necessasry patches as well.

1 Like

Hey boogie woogie
Can you please add this to your guide first post?

How to turn on the fan:


git clone https://github.com/XZhouQD/Rock5B_Naive_Pwm_Fan
cd Rock5B_Naive_Pwm_Fan/
cp fan_pwm /usr/local/bin/. 
chmod +x /usr/local/bin/fan_pwm
cp fan_pwm.service /etc/systemd/system/.
systemctl daemon-reload 
systemctl start fan_pwm
systemctl enable fan_pwm

There is always people asking.

2 Likes

Sorry, but I need a little hand holding. Computer A is the 5b, computer B is an x86 Arch install. I put a sd card via usb adapter into B and run the script installing on sd card. As the script runs I get messages about fstab but the script completes. I put the card into the 5b but it does not boot. Blue light does not change to green. If I check the install back on B there is nothing in fstab file. Any ideas? Thanks

What’s the difference between Rock5B_Naive_Pwm_Fan and fan-control ?

No clue I didnt even tried that app yet.

Hi, I’ve been trying to get this to work. I run the instal script and I end up with a bootable system, but I cannot seem to log-in using the default credentials (alarm/alarm or root/root). I’ve tried over ssh and connected to a keyboard/mouse + monitor, none work. Am I missing something obvious?

SD Card, didn’t explicitly do anything with regards to the boot loader, so presumably u-boot? BSP Kernel.

I mean 1. Booted with display but can’t login.

@kwankiu

I think i know what the problem is with kernel fan control. Simply the current config of debian of Radxa does not have CONFIG_SENSORS_PWM_FAN in config which enables the pwm-fan module in the kernel. The dts changes are already there.

I have compiled the git kernel with such config changes applied in the link could you please verify if this works, i dont have a fan to test.

make sure the soc_thermal policy is at step_wise, if not set it.

cat /sys/class/thermal/thermal_zone0/policy
echo "step_wise" > /sys/class/thermal/thermal_zone0/policy

stress test with s-tui or streess-ng

if you set your policy to user_space, then those funky fan control software tools would still work, but for the rest of policies, kernel is taking over the control of the pwm. With an overlay you can also customize the fan curve of the kernel controller as well.

see:

Please note that about post is for armbian, radxa kernel have 5 stages curve unlike armbians 9 stages.

test kernel:

ps: i think, i think i can force default policy to step_wise by as well with CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y so people wont have to deal with it …
ps2: the change request to radxa kernel https://github.com/radxa/kernel/pull/197

1 Like

@kwankiu

Also, i checked the installation script. Rockchip devices require a specific offset when they want to boot from, that is 0x8000 (32768) sectors, or 16MB. But the scripts are starting from the first sector. I think it will not boot this way. Also please make sure the boot flag is activated

https://opensource.rock-chips.com/wiki_Boot_option
Please ignore loader 1 & 2, trusted zone and only focus on boot_start. The previous regions are on spi flash for rock5. rock4 is different though.

You can also refer to Radxa’s build scripts on how this works

1 Like

@boogiepop, btw, midstream pancsf works if I first install panfork, then pacman -Rns mesa-panfork-git-debug (this is the only package that reports conflict), then install pancsf. But seems only on X11. Most apps (gnome settings, terminal, chromium, etc.) wont launch if I logout and login to Wayland.

Thanks, I didnt realise this as NVMe drive seems works without the need of this.

This should now get fixed on the dev branch, but I couldn’t test them on NVMe as my USB NVMe Adapter seems overheat and broken. So only sd card are tested. updates: I got the adapter worked once. Both SD card and NVMe should works now. The fix is now committed to main.

@tkaiser @Joperfi flash again and it should works now.

uhm, i dont have an environment to test this, but did you set the boot flag in the script? i could not see it.

Boot flag is now added.

in the meanwhile, i am discussing adding the rock5b packages to 7Ji’s binary repo, so everyone can use the same thing. Compiling stuff on those SBCs can be punishing for everyday users.

The pwm fan works with that. At first I thought it doesnt as the curve is set to spin the fan only when stress reaches above 60C, once it gets below 61C, the fan stops.

Btw, the bluetooth for A8 / RTL8852BE, dmesg shows :

[    6.702962] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.6d45ddf.20220519-142432
[    6.703049] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[    6.703050] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[    6.703052] rtk_btusb: patch_add
[    6.703053] rtk_btusb: auto suspend is disabled
[    6.703055] rtk_btusb: pid = 0x4853
[    6.703057] rtk_btusb: patch_add: Reset gEVersion to 0xff
[    6.703065] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[    6.703705] rtk_btusb: btusb_probe: done
[    6.703730] rtk_btusb: btusb_open start
[    6.703734] rtk_btusb: btusb_open hdev->promisc ==0
[    6.703738] rtk_btusb: download_patch start
[    6.703741] rtk_btusb: chip type value: 0x77
[    6.703746] rtk_btusb: HCI reset.
[    6.703758] usbcore: registered new interface driver rtk_btusb
[    6.716405] rtk_btusb: read_ver_rsp->lmp_subver = 0x8852
[    6.716414] rtk_btusb: read_ver_rsp->hci_rev = 0xb
[    6.716418] rtk_btusb: patch_entry->lmp_sub = 0x8852
[    6.716422] rtk_btusb: load_firmware start
[    6.716425] rtk_btusb: lmp_version = 0x8852
[    6.716428] rtk_btusb: config filename rtl8852bu_config
[    6.717099] usb 1-1.3: Direct firmware load for rtl8852bu_config failed with error -2
[    6.717106] rtk_btusb: fw name is  rtl8852bu_fw
[    6.717246] usb 1-1.3: Direct firmware load for rtl8852bu_fw failed with error -2
[    6.717249] rtk_btusb: load firmware failed!
[    6.717252] rtk_btusb: Rtk patch end -1
[    6.717259] rtk_btusb: btusb_open failed

obviously the firmware is missing, i think radxa should have special firmware repo, i am currently using mainline firmware packages.

@kwankiu could you test afterwards you download 8852bu_fw 8852bu_config to /usr/lib/firmware from the location:

https://github.com/radxa-pkg/radxa-firmware/tree/main/firmware

you need to restart or reload the kernel module for them to find the firmware.

@boogiepop Yes,
with 8852bu_fw and 8852bu_config in /usr/lib/firmware, bluetooth now works.

1 Like

Ok, i will update the linux packages, this should have been auto handled by the package.

So everthing is solved now?