Jiseoup / preempt-rt

How to patch preempt RT in ubuntu 18.04.

Repository from Github https://github.comJiseoup/preempt-rtRepository from Github https://github.comJiseoup/preempt-rt

PREEMPT RT PATCH on Ubuntu 18.04

This document introducing how to install PREEMPT RT on ubuntu 18.04.
I got the information from here.

INSTALL DEPENDENCIES

$ sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev git

DOWNLOAD AND PATCH

Download the linux-5.4.193 kernel and the RT patch from kernel.org.

$ wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.193.tar.xz
$ wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.4/patch-5.4.193-rt74.patch.xz

Extract the file and apply the patch.

$ xz -cd linux-5.4.193.tar.xz | tar xvf -
$ cd linux-5.4.193
$ xzcat ../patch-5.4.193-rt74.patch.xz | patch -p1

CONFIGURATION

Copy the old config file.

$ cp -v /boot/config-$(uname -r) .config

EDIT CONFIG FILE

You may have to edit the .config file.

$ vim .config

Search the CONFIG_SYSTEM_TRUSTED_KEYS and erase the contents inside the double quotation marks.

Before Modification

After Modification

MENUCONFIG SETTINGS

You have to set the menu configuration.

$ make menuconfig

Essential

General setup -> Preemption Model -> Fully Preemptible Kernel (Real-Time)
Processor type and features -> Timer frequency -> 1000 HZ

Optional

If you want to use the kernel as a uniprocessor, follow the instructions below.

Processor type and features -> Symmetric multi-processing support -> [OFF]

Now save the menuconfig and exit.

Save -> Exit

BUILD AND INSTALL

$ make -j $(nproc) deb-pkg
$ sudo dpkg -i ../linux-headers-5.4.193-rt74_5.4.193-rt74-1_amd64.deb 
               ../linux-image-5.4.193-rt74_5.4.193-rt74-1_amd64.deb 
               ../linux-libc-dev_5.4.193-rt74-1_amd64.deb

Verification

Reboot your system and check the kernel.

$ sudo reboot
$ uname -a

About

How to patch preempt RT in ubuntu 18.04.