An open API service indexing awesome lists of open source software.

https://github.com/jiseoup/preempt-rt

How to patch preempt RT in ubuntu 18.04.
https://github.com/jiseoup/preempt-rt

Last synced: 2 months ago
JSON representation

How to patch preempt RT in ubuntu 18.04.

Awesome Lists containing this project

README

        

# 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](https://chenna.me/blog/2020/02/23/how-to-setup-preempt-rt-on-ubuntu-18-04/).

## INSTALL DEPENDENCIES
```bash
$ 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](https://kernel.org).
```bash
$ 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.
```bash
$ 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.
```bash
$ cp -v /boot/config-$(uname -r) .config
```

## EDIT CONFIG FILE
You may have to edit the **`.config`** file.
```bash
$ 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.
```bash
$ 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
```bash
$ make -j $(nproc) deb-pkg
```

```bash
$ 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.
```bash
$ sudo reboot
$ uname -a
```