Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PREEMPT_RT patch for rockchip rk-5.10-rkr8?

Featured Replies

Hello. I'm looking for a PREEMPT_RT patch for your linux-rockchip kernel.

I've tried to apply an rt101 patch for 5.10.209 (branch rk-5.10-rkr8), but it has so many differences (especially, scheduler-related)...  I've spend a lot of time resolving the conflicts manually but my kernel keeps crashing on start.

 

Please, help me...

Edited by SysProg
branch

  • Author

@Werner thank you for your reply. I haven't seen a 6.1.y kernel from rockchip, only v5.10 and below. May I ask you for a link? Or do you mean v6.1.y of mainline linux kernel?

 

Edited by SysProg
typo

@SysProg I'm also looking for a way to got a PREEMPT_RT kernel for Armbian. I followed the instructions from **indianajones**  https://forum.armbian.com/topic/11491-real-time-operating-system/ to include a rt patch and running the `compile.sh` script.

The patching and kernel compilation works, but the `compile.sh` script fails because of wrong references of filenames.

 

Steps to reproduce:

- Build environment: Docker

- Board: lime2

- Kernel Release: jammy (22.04)

- Kernel version: 6.6.75

- RT-Patch: patch-6.6.74-rt48.patch.xz https://www.kernel.org/pub/linux/kernel/projects/rt/6.6/older/patch-6.6.74-rt48.patch.xz

 

Packaging linux-image [ sunxi linux-sunxi-current ] 
[🐳|🔨] [ 14M] /armbian/.tmp/work-faa9b4e0-5171-48e1-a64e-1437de80d285/kernel_dest_install_dir-GxS0c/image/boot 
[🐳|🔨] ├── [211K] config-6.6.75-rt48-current-sunxi
[🐳|🔨] ├── [3.6M] System.map-6.6.75-rt48-current-sunxi 
[🐳|🔨] └── [ 10M] vmlinuz-6.6.75-rt48-current-sunxi 
[🐳|🔨]
[🐳|🔨] 14M used in 0 directories, 3 files 
[🐳|🌱] Kernel-built image filetype [ vmlinuz-6.6.75-current-sunxi: cannot open `/armbian/.tmp/work-faa9b4e0-5171-48e1-a64e-1437de80d285/kernel_dest_install_dir-GxS0c/image/boot/vmlinuz-6.6.75-current-sunxi' (No such file or directory) ] 
[🐳|🔨] ls: cannot access '/armbian/.tmp/work-faa9b4e0-5171-48e1-a64e-1437de80d285/kernel_dest_install_dir-GxS0c/image/boot/vmlinuz-6.6.75-current-sunxi': No such file or directory

 

The related function is `kernel_package_callback_linux_image()` inside `kernel-debs.sh`.

 

I'm still try to find out how to solve this failure. The hook `call_extension_method "pre_package_kernel_image"` is maybe to key, or some extra build commands like *KERNEL_CONFIGURE*.
I tried this quick and dirty extension, but no success so far:

function pre_package_kernel_image__600_set_kernel_name() {
    # Determine the correct kernel image file name
    kernel_image_file=$(ls "${kernel_pre_package_path}/vmlinuz-6.6.75-*" 2>/dev/null)
    if [ -z "$kernel_image_file" ]; then
        echo "Error: Kernel image file not found!" >&2
        run_host_command_logged ls -la "${kernel_pre_package_path}"
        exit 1
    fi

    # Set the correct kernel image name
    kernel_image_pre_package_path="$kernel_image_file"
    echo "Using kernel image file: $kernel_image_pre_package_path"
}

 

Any help will be welcome.

Edited by Seihan

  • Author

Hi @Werner! I configured the 6.1 kernel (manually added an RT-patch too), but I have problems booting it, it only detects mmcblk0boot* partitions from my card and no rootfs/user partitions.

My uboot is a slightly modified old rockchip-uboot of 2017. Does kernel 6.1 require a newer uboot? If so, which one should I take?

 

Nevermind, my bad! I've missed a CONFIG_EFI_PARTITION...

 

@Seihan, sorry, I cannot use 6.6 for some reasons, only 6.1 and below, so I can't be any of help

Edited by SysProg

@SysProg can you please provide instructions how you patched the kernel?

As mentoined, I used the armbian build script. The RT patch is the last of 8 patches in my case. I'm trying to solve the issue with an extension hook.  I use a second extension to modify the partitions on the image, this may solve your problem. The hooks format_partitions, and prepare_image_size are used for this as described here 

 

I successfully built an armbian image with PREEMPT_RT kernel, by changing line 52 in armbian/lib/functions/compilation/kernel-debs.sh into:

declare kernel_version_family="${kernel_version}-rt48-${BRANCH}-${LINUXFAMILY}"

This isn't a valid solution, but it worked for me, for this moment.

 

root@lime2 ~ # uname -a
Linux lime2 6.6.75-rt48-current-sunxi #19 SMP Sat Feb  1 17:37:57 UTC 2025 armv7l armv7l armv7l GNU/Linux

 

Limitations:

- works only for rt48

- kernel 6.6.75

- patch-6.6.74-rt48.patch.xz

 

It is not possible to pin the build process to specific kernel version tags. The option exists, but it has no effect. Any hints on how to pin the builder to a specific kernel would be helpful to reproduce this build in the future.

10.03.2025 в 09:40, SysProg сказал:

I'm looking for a PREEMPT_RT patch for your linux-rockchip kernel.

I've tried to apply an rt101 patch for 5.10.209 (branch rk-5.10-rkr8), but it has so many differences (especially, scheduler-related)...  I've spend a lot of time resolving the conflicts manually but my kernel keeps crashing on start.

Maybe you can describe the problem/goal that you want to solve using RT Core.

 

First you need to figure out what is required.
There are several real-time Cores. And each solves its own problems.

This one I made for the Orange Pi 5, perhaps it works also on yours:

https://drive.google.com/drive/folders/1r76sUsfG_F8pq0pkzzPgEyzqdRG6fGcz

 

These for RK3399

https://drive.google.com/drive/folders/12VfNmKC30vxNzaNAk2EN5sHDfeCnnzYX

 

For the 5.10.160 kernel there's an already rt patched source from Orange Pi:

https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-5.10-rk35xx-rt

 

And when you apply an rt patch in Armbian, you should remove the local version patch. Armbian doesn't support local versions

Edited by royk

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.