\subsection{Writing recipes}
\begin{frame}[fragile]
\frametitle{adding a kernel}
create the file 'meta-mybsp/recipes-bsp/linux-vanilla/linux-vanilla\_3.16.1.bb':
\begin{verbatim}
SECTION = "kernel"
DESCRIPTION = "Linux vanilla kernel"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
KERNEL_IMAGETYPE ?= "uImage"

inherit kernel
require recipes-kernel/linux/linux-dtb.inc
\end{verbatim}
\end{frame}

\begin{frame}[fragile]
\frametitle{adding a kernel \#2}
\begin{verbatim}
COMPATILBE_MACHINE_imx6qsabrelite = "imx6qsabrelite"
KERNEL_DEVICETREE_imx6qsabrelite = "arch/arm/boot/dts/imx6q-sabrelite.dts"
COMPATILBE_MACHINE_beaglebone-black = "beaglebone-black"
KERNEL_DEVICETREE_beaglebone-black = "arch/arm/boot/dts/am335x-boneblack.dts"

S = "${WORKDIR}/git

BRANCH = "master"
SRC_URI = "https://www.kernel.org/pub/linux/kernel/v3.x/linux-${PV}.tar.xz \
           file://defconfig"

SRC_URI[md5sum] = "e7a985a243b7941b6bc6240fcbc797fc"
SRC_URI[sha256sum] = "be37dda8ea090525661d64e5c7fc8580f313b7f9ba8592e32120f1332b

KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
LINUX_VERSION_EXTENSION = "-linutronix"

do_configure_prepend() {
   cp '${WORKDIR}/defconfig' '${S}/.config'
}
\end{verbatim}
\end{frame}

\begin{frame}[fragile]
\frametitle{adding a defconfig}
copy your .config file to
'meta-mybsp/recipes-bsp/linux-vanilla/files/beaglebone-black/defconfig'
\end{frame}

\begin{frame}[fragile]
\frametitle{using a specific kernel}
add
\begin{verbatim}
PREFERRED_PROVIDER_virtual/kernel = "linux-vanilla"
\end{verbatim}
to meta-mybsp/machine/beaglebone-black.conf
\end{frame}

\begin{frame}[fragile]
\frametitle{Providers}
\begin{verbatim}
--8<- meta/classos/kernel.bbclass --
PROVIDES += "virtual/kernel"
--8<--------------------------------
\end{verbatim}

PREFERRED\_PROVIDER\_virtual/kernel = "linux-vanilla"


\vspace{2em}
also a preferred version can be set:

PREFERRED\_VERSION\_virtual/kernel = "3.18.5"
\end{frame}
