Select Region/Language
EN CN
RPI Developer / Operating System / Installing a real-time Ubuntu kernel on a Raspberry Pi

Installing a real-time Ubuntu kernel on a Raspberry Pi

adminPublish at 2025-02-06
6986 views
:warning: Warning This is purely a pet project of mine done in my spare time. It is not endorsed nor supported by Canonical. The kernel you’re about to install may not receive any patches or security updates. It it not thoroughly tested and may render your system unusable or even destroy your data. Use at your own risk.

If you’re interested in having a play with a real-time Ubuntu kernel on a Raspberry Pi, you’ve come to the right place  See this article 209 for an introduction to real-time Linux.

Article URL:https://ubuntu.com/engage/an-introduction-to-real-time-linux

At the moment I only provide arm64 6.2 kernel packages for Ubuntu Lunar (via my raspi-rt PPA 163), so you need to install a 64-bit Lunar image, preferably on a Raspberry Pi 4B (or any other BCM2711 based model). Check out this guide 98 if you need help with that.

raspi-rt PPA:https://launchpad.net/~juergh/+archive/ubuntu/raspi-rt

View Guide:https://discourse.ubuntu.com/t/how-to-install-ubuntu-server-on-your-raspberry-pi/14660

My kernel is based on the official Ubuntu raspi 6.2 kernel with the raspi-rtupstream RT 69 patchset applied and the relevant config option (PREEMPT_RT) enabled.

RT Patch Set:https://wiki.linuxfoundation.org/realtime/preempt_rt_versions

Once your Pi is up and running Ubuntu Lunar, you need to tweak to recognize the new kernel flavor. For that, run the following command. This needs to be done only once.flash-kernelraspi-rt

$ sudo sed -i 's/\(raspi-nolpae\)$/\1 raspi-rt/' /usr/share/flash-kernel/db/all.db

Next, add my raspi-rt PPA 163 to your system and install the kernel packages:

$ sudo apt-add-repository -P juergh/raspi-rt
$ sudo apt install linux-raspi-rt

Depending on the other kernels installed on you system, you might need to tell to use the newly installed kernel as the boot kernel:flash-kernelraspi-rt

$ sudo flash-kernel --force 6.2.0-1003-raspi-rt

That’s it. Now reboot and check that the RT kernel is running:

$ uname -a
Linux rpi-4b-rev1d2-2c1a 6.2.0-1003-raspi-rt #3+rt3.1-Ubuntu SMP PREEMPT_RT Mon Mar 27 11:27:37 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

You might also want to install the package which provides a couple of tools to evaluate latency and other kernel aspects of your shiny new real-time system. Have fun and let me know how it goes but don’t expect any support rt-tests:wink:

Original URL: https://discourse.ubuntu.com/t/installing-a-real-time-ubuntu-kernel-on-a-raspberry-pi/34833

Raspberry Pi Raspberry Pi Raspberry Pi5 Tutorial Ubuntu

EDATEC

Started in 2017, EDATEC has been certified as one of the global design partners of Raspberry Pi since 2018, providing Raspberry Pi based industrial computers design and manufacturing services for global customers.

  • Building 29, No. 1661, Jialuo Road, Jiading District, Shanghai.
  • CN: +86-18217351262 (Iris Zhou)
    US: +1 859-653-0800 (Randall Restle)
  • support@edatec.cn
Submit Your Message

INFO

By submitting, you agree to EDATEC's policies

Please enter the verification code

captcha
0.580805s