In order to successfully build and install the Real-Time Linux kernel, several requirements must be met.
Downloaded kernel and patch archives need to be unpacked. It can be done either using any available GUI archive manager or via command line:
$ tar -jxvf linux-<kernel_version>.tar.bz2 $ bunzip2 patch-<patch_version>.bz2
After positioning inside the unpacked kernel source directory, assuming both archives were extracted in the same parent directory, the kernel can be patched with patch level p1:
$ cd linux-<kernel_version> $ patch -p1 <../patch-<kernel_version>
Before compiling freshly patched kernel, it needs to be properly configured. It is recommended to copy configuration file of the existing distribution:
$ cp /boot/config-`uname -r` .config
This will reduce the number of necessary configuration changes and help avoiding hardware specific options configuration issues. Real-time related options can be configured by invoking the text based kernel configuration menu (requires the ncurses libraries):
$ make menuconfig
Recommended configuration settings, gathered from several sources, are listed below:
Screenshots of all other relevant options (determined through multiple build and installation attempts) are given here TODO fix the link.
Once all the options are properly configured and saved, the new kernel can be compiled:
$ make -j <jobs>
Number of processes created can be specified with <jobs>. Parameter should be equal to twice the number of cores of the processor used, as this will speed up kernel compilation considerably. Compiled kernel can be installed with:
$ make modules_install install
After system reboot, the newly installed kernel becomes part of the boot menu. GRUB boot loader can be modified with Grub Customizer to make real-time kernel default or to remove the old kernel from the boot menu.
Successfully installed kernel version should contain the tags PREEMPT and RT:
$ uname -v #1 SMP PREEMPT RT Tue Mar 31 22:14:03 EDT 2015