RT Preempt Patch Linux
RT Preempt Patch Linux
EtienneAr
April 2019
This document will present what I did to install (patch) real-time Linux.
1 Ubuntu 16.04
1.1 Download and install Ubuntu
I did the install, by downloading Ubuntu 16, and creating a live USB stick. Then I followed the Live USB
instructions.
wget http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso
#Choose the correct device which will be the output (a.k.a ’of’) to create
Live USB.
lsblk
From now on, everything will be done on the freshly installed machine (either by typing
physically on it, or by using a ssh conneciton).
1
unsigned-4.14.109-0414109-generic_4.14.109-0414109.201903271718_amd64.
deb
wget https://kernel.ubuntu.com/˜kernel-ppa/mainline/v4.14.109/linux-modules
-4.14.109-0414109-generic_4.14.109-0414109.201903271718_amd64.deb
sudo update-grub
sudo reboot
1.5 (optional) Get the system info (before changing the kernel too much)
mkdir info
cd info
2
git clone git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
cd rt-tests
git checkout stable/v1.0
make
sudo ./cyclictest -a -t -n -p99
mkdir -p /usr/src/kernels
cd /usr/src/kernels
wget http://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.109.tar.gz
wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/4.4/patch
-4.14.109-rt57.patch.xz
xz -d ../patch-4.14.109-rt57.patch.xz
patch -p1 <../patch-4.14.109-rt57.patch
cp /boot/config-4.15.x-xxx-generic .config
# ’minimum’ configuration
make defconfig
3
unecessary brand
# * Device drivers > Network > Wireless lan (see list)
# * Device drivers > Network -> (disable) USB
# ... Better settings can be done ...
Remark: A lot of optimization can be done during the ’make menuconfig’ step, by disabling everything
that is not necessary.
1.9 Compile
### In my case, I need these to compile ###
apt-get install libsdl1.2-dev libssl-dev
1.10 Reboot
reboot
4
1.11 Checks
uname -a
sudo cat /proc/cpuinfo
lspci
make
2 Miscellaneous
2.1 Remove an installed kernel :
#Current kernel
uname -r
#DO NOT REMOVE IT