1. Centos 7 Real Time Preempt - mparra-mpz/real-time GitHub Wiki

Hardware Components

Software Components

System Configurations

  • Enable ethernet interface to start automatically.
vi /etc/sysconfig/network-scripts/ifcfg-eth0 
ONBOOT=yes
  • Install and initialize ssh service.
yum install openssh openssh-server openssh-clients
chkconfig sshd on
service sshd start
  • Configure plymouth to display the system load details.
plymouth-set-default-theme details
dracut -f
  • Install EPEL and RPM Fusion repositories.
yum install epel-release
yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
  • Update the System and reboot it.
yum -y update
reboot
  • Install software necessary for the kernel compilation.
yum install kernel kernel-devel kernel-headers
yum install net-tools wget htop vim stress lm_sensors git
yum install make gcc gcc-c++ gcc-gnat gcc-gfortran perl
yum install patch ncurses ncurses-devel numactl numactl-devel
yum install openssl openssl-devel bc elfutils-libelf elfutils-libelf-devel

Configure and Compile Kernel Real Time

  • Get the kernel sources and real time patch and uncompress them.
wget -c https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.77.tar.gz
wget -c https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/patch-4.9.76-rt61.patch.gz

tar xvzf linux-4.9.77.tar.gz 
gunzip patch-4.9.76-rt61.patch.gz 
  • Create a kernel configuration file, first copy the current kernel configuration file to kernel sources folder.
cd linux-4.9.77
cp -rf /boot/config-3.10.0-693.11.6.el7.x86_64 .config
  • Patch the kernel with preempt real time patch.
patch -p1 < ../patch-4.9.76-rt61.patch
  • Access to kernel configuration menu and disable the Virtualization and Power Management and ACPI options (Disable all the functionalities except Device power management core functionality). Now you have to enable the preempt capacities, go to Processor type and features, then to Preemption Model and finally select Fully Preemptible Kernel. Save the configuration and exit from configuration menu.
make menuconfig
  • Compile the kernel sources, to speed up the process use all the cores with the option -j and numbers of cores plus one, in my case 3.
make -j3
  • Compile the kernel modules, to speed up the process use all the cores with the option -j and numbers of cores plus one, in my case 3.
make modules -j3
  • Install the kernel modules.
make modules_install
  • Install the kernel.
make install
  • In the /boot partition you will find the new kernel files.
-rw-r--r--. 1 root root 5,5M ene 21 21:24 vmlinuz-4.9.77-rt61
-rw-r--r--. 1 root root 3,1M ene 21 21:24 System.map-4.9.77-rt61
-rw-------. 1 root root  55M ene 21 21:28 initramfs-4.9.77-rt61.img
  • Configure grub to use the new kernel.
vim /etc/default/grub
GRUB_DEFAULT=0

grub2-mkconfig -o /boot/grub2/grub.cfg
  • Smile :) we are done, so reboot the system.
reboot
  • After the reboot the new kernel preempt will be loaded.
uname -a
Linux tarro 4.9.77-rt61 #2 SMP PREEMPT RT Sun Jan 21 20:48:18 -03 2018 x86_64 x86_64 x86_64 GNU/Linux