2
votes

I like to play around with a pre-emptive linux kernel and Yocto. As hardware the SAMA5D3x Evalboard + SAMA5D35-CM module is used.

Atmel is providing a meta-atmel layer, which includes the "at91-linux_*.bb" recipe. This recipe builds the kernel for the SAMA5D3x machines.

For using the realtime kernel I should insert the realtime patches and activate them at the kernel config.

I did not found a tutorial how to do this with an existing kernel. My question is:

How/where to modify a given kernel recipe to make it a realtime kernel(preempt-rt)?

My test project is located at the project dir "/home/user/yocto". It has following content:

  • "/yocto git clone" ==> Yocto system
  • "/meta-openembedded" ==> meta embedded recipes
  • "/meta-atmel" ==> atmels yocto layer
  • "/meta-atmel/recipes-kernel/linux/linux-at91_4.4.bb" ==> the kernel recipe
  • "/meta-atmel/conf/machine/sama5d3xek.conf" ==> the machine that run the kernel
  • "/myTest" ==> my test project
  • "/myTest/recipes-kernel/linux-at91_%.bbappend" ==> replace the kernel config + add own device tree
  • "/myTest/recipes-kernel/linux/linux-at91/sama5d3xek/defconfig" ==> my own kernel config
  • /myTest/recipes-kernel/linux/linux-at91/sama5d3xek/myDev.dts ==> my own device tree

Any ideas/tutorials how to manage to activate the RT-Kernel in Yocto?

1

1 Answers

2
votes

In general:

in .../source/poky/recipes-kernel/linux you should find a linux-yocto-rt_X.XX.bb recipe to compile a full preemptive RT kernel.

For meta-atmel you should do:

  1. Download the correct RT patch for your kernel version and apply it using a .bbappend file to your current linux kernel recipe. You could find the patch HERE
  2. Add the patch to your bbappend file (stored in your own layer in the one of accepted direcotries). p.e.: SRC_URI += "file://0001-linux-rt.patch"
  3. Activate preemptive kernel. Manually set CONFIG_PREEMPT=y at defconfig at your layer. Alternativly you can use bitbake virtual/kernel -c menuconfig

Pitfalls at meta-atmel:

  1. the linux-at91_4.4.bb recipe does not care about patch and sublevel of the kernel (p.e. 4.4.66 -> ..). if there is a new version at at91-linux it will go after some time to the meta-atmel layer.
  2. the RT branch of the linux kernel is not provided for every new sublevel
  3. this means constant breaks of your own meta-layer