summaryrefslogtreecommitdiff
path: root/distribution/yocto-example-layer/rtpreempt.tex
diff options
context:
space:
mode:
Diffstat (limited to 'distribution/yocto-example-layer/rtpreempt.tex')
-rw-r--r--distribution/yocto-example-layer/rtpreempt.tex86
1 files changed, 86 insertions, 0 deletions
diff --git a/distribution/yocto-example-layer/rtpreempt.tex b/distribution/yocto-example-layer/rtpreempt.tex
new file mode 100644
index 0000000..037ca58
--- /dev/null
+++ b/distribution/yocto-example-layer/rtpreempt.tex
@@ -0,0 +1,86 @@
+\subsection{Add RT PREEMPT Linux kernel patch}
+
+\begin{frame}[fragile]
+\frametitle{Define an 'rt' override}
+\begin{lstlisting}
+$ cd ~/poky/meta-schulung
+$ pluma conf/machine/vexpress.conf
+\end{lstlisting}
+\begin{verbatim}
+DEFAULTTUNE ?= "armv7athf-neon"
+require conf/machine/include/tune-cortexa8.inc
+SERIAL_CONSOLE = "115200 ttyAMA0"
+PREFERRED_PROVIDER_virtual/kernel = "linux-vanilla"
+UBOOT_MACHINE = "vexpress_ca9x4_defconfig"
+IMAGE_FSTYPES = "wic"
+MACHINEOVERRIDES .= ":rt"
+\end{verbatim}
+NOTE: this could also be done e.g. in distro/schulung.conf within
+DISTROOVERRIDES.
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Add patch to kernel recipe}
+\begin{lstlisting}
+$ cd ~/poky/meta-schulung
+$ pluma recipes-bsp/linux-vanilla/linux-vanilla-4.19.1.bb
+\end{lstlisting}
+\begin{verbatim}
+SECTION = "kernel"
+DESCRIPTION = "Linux vanilla kernel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+inherit kernel
+
+COMPATIBLE_MACHINE_vexpress = "vexpress"
+KERNEL_DEVICETREE_vexpress = "vexpress-v2p-ca9.dtb"
+SRC_URI = "file://linux-${PV}.tar.gz file://defconfig"
+
+RTPATH = "pub/linux/kernel/projects/rt"
+SRC_URI_rt := "${SRC_URI} \
+ https://kernel.org/${RTPATH}/4.19/patch-4.19.1-rt3.patch.gz;name=rt"
+
+SRC_URI[rt.md5sum] = "ce96db835c310c195dd0f0046b2ea993"
+SRC_URI[rt.sha256sum] = "649334844cfa427b08dc72debb1d5e672a3dcafc64089770fcdfa06dcc433e31"
+
+S = "${WORKDIR}/linux-${PV}"
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Enable full preemption}
+\begin{lstlisting}
+$ cd ~/poky/build-schulung
+$ bitbake -c menuconfig linux-vanilla
+\end{lstlisting}
+select from the menu:
+\begin{verbatim}
+ | 'General Setup
+ | 'Preemption Model'('Fully Preemtpible Kernel (RT)')
+\end{verbatim}
+Exit and save changes
+\begin{lstlisting}
+$ bitbake -c diffconfig linux-vanilla
+$ mv tmp/work/vexpress-schulung-*/linux-vanilla/*/fragment.cfg \
+ ../meta-schulung/recipes-bsp/linux-vanilla/files/rt.cfg
+$ cd ~/poky/meta-schulung
+$ pluma recipes-bsp/linux-vanilla/linux-vanilla-4.19.1.bb
+\end{lstlisting}
+\begin{verbatim}
+[..]
+SRC_URI_rt := "${SRC_URI} \
+ https://kernel.org/${RTPATH}/4.19/patch-4.19.1-rt3.patch.gz;name=rt \
+ file://rt.cfg \
+[..]
+"
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Rebuild image}
+\begin{lstlisting}
+$ cd ~/poky/build-schulung
+$ bitbake core-image-schulung
+\end{lstlisting}
+\end{frame}