Getting the PREEMPT_RT patches

The RT developers do not create patch sets for every kernel version because of the amount of effort involved. On average, they create patches for every other kernel. The most recent kernels that are supported at the time of writing are as follows:

  • 4.1-rt
  • 4.0-rt
  • 3.18-rt
  • 3.14-rt
  • 3.12-rt
  • 3.10-rt

The patches are available at https://www.kernel.org/pub/linux/kernel/projects/rt.

If you are using the Yocto Project, there is an rt version of the kernel already. Otherwise, it is possible that the place you got your kernel from already has the PREEMPT_RT patch applied. Otherwise, you will have to apply the patch yourself. Firstly, make sure that the PREEMPT_RT patch version and your kernel version match exactly, otherwise you will not be able to apply the patches cleanly. Then you apply it in the normal way, as shown here:

$ cd linux-4.1.10
$ zcat patch-4.1.10-rt11.patch.gz | patch -p1

You will then be able to configure the kernel with CONFIG_PREEMPT_RT_FULL.

There is a problem in the last paragraph. The RT patch will only apply if you are using a compatible mainline kernel. You are probably not because that is the nature of embedded Linux kernels and so you will have to spend some time looking at failed patches and fixing them, and then analyzing the board support for your target and adding any real-time support that is missing. These details are, once again, outside the scope of this book. If you are not sure what to do, you should inquire of the developers of the kernel you are using and on kernel developer's forums.

The Yocto Project and PREEMPT_RT

The Yocto Project supplies two standard kernel recipes: linux-yocto and linux-yoco-rt, the latter having the real-time patches already applied. Assuming that your target is supported by these kernels, then you just need to select linux-yocto-rt as your preferred kernel and declare that your machine is compatible, for example, by adding lines similar to these to your conf/local.conf:

PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.237.79