From 5d9043ce4f07dbc63a2996874e798de4a83538c2 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 27 Nov 2018 22:57:33 +0100 Subject: add 'yocto-layer-example' This is a first attemp to create a new slideset for day2 of yocto-trainig. The slideset is based on 'yocto-advanced' but with integration of 'meta-schulung' explanations. I used a slightly modified version of 'meta-schulung'. The following changes are currently not available in git: I don't use linux-yocto in meta-schulung, but use an own kernel-recipe and integrate the RT-PREEMPT patch. wic: i can't see the need for the second partition and the need for huge files in the kconfig. It works for me by adding ' --align 1024 ' to the wic setup. I decided to use ext2 instead of ext4. I renamed the rootfs.bb file into schulung-base.bb I use the u-boot recipe from poky. However i don't use u-boot for anything atm. But bootloader is on our agenda.. Signed-off-by: Manuel Traut --- distribution/yocto-example-layer/yocto-layers.tex | 84 +++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 distribution/yocto-example-layer/yocto-layers.tex (limited to 'distribution/yocto-example-layer/yocto-layers.tex') diff --git a/distribution/yocto-example-layer/yocto-layers.tex b/distribution/yocto-example-layer/yocto-layers.tex new file mode 100644 index 0000000..a9eebb6 --- /dev/null +++ b/distribution/yocto-example-layer/yocto-layers.tex @@ -0,0 +1,84 @@ +\subsection{Yocto Layers} + +\begin{frame} +\frametitle{bitbake-layers} +is useful to debug relations between different layers, options are: +\begin{description} +\item [show-layers] shows the current configured layers +\item [show-recipes] lists available recipes and the layers that provide them. +\item [show-overlayed] lists overlayed recipes +\item [show-appends] lists .bbappend files + and the recipe files to which they apply +\item [show-cross-depends] lists dependency relationships + between recipes that cross layer boundaries +\item [flatten] flattens the layer configuration + into a separate output directory. +\end{description} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Create and use own layer} +\begin{lstlisting} +$ cd ~/poky +$ . ./oe-init-build-env build-schulung +$ cd .. +$ bitbake-layers create-layer -p 10 meta-schulung +NOTE: Starting bitbake server... +Add your new layer with 'bitbake-layers add-layer meta-schulung' +$ cd build-schulung +$ bitbake-layers add-layer ../meta-schulung +NOTE: Starting bitbake server... +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Folder layout} +\begin{verbatim} +meta-schulung ++ conf +| + layer.conf ++ classes +| + class1.bbclass +| + class2.bbclass ++ recipes-category1 +| + package-1 +| + package-1.bb +| + package-2 +| + package-2.bb ++ recipes-category2 +| .. +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{meta-*/conf/layer.conf} +each layer needs a configuration file +\begin{itemize} +\item add conf and class directories to BBPATH +\begin{verbatim}BBPATH =. "${LAYERDIR}"\end{verbatim} +\item add recipe directories to BBFILES +\begin{verbatim}BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend"\end{verbatim} +\item add layer name to BBFILE\_COLLECTIONS +\begin{verbatim}BBFILE_COLLECTIONS += "mylayer"\end{verbatim} +\item set root of the layer +\begin{verbatim}BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"\end{verbatim} +\item set default priority of the layer +\begin{verbatim}BBFILE_PRIORITY_mylayer = "5"\end{verbatim} +\item set version of layer (only increment if dependencies with other + layers are affected) +\begin{verbatim}LAYERVERSION_mylayer = "2"\end{verbatim} +\item set dependencies to other layers +\begin{verbatim}LAYERDEPENDS_mylayer = "meta-yocto"\end{verbatim} +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Definitions} +\begin{itemize} +\item It is possible for a recipe with a lower version number PV in a layer +that has a higher priority to take precedence. +\item Also, the layer priority does not currently affect the precedence +order of .conf or .bbclass files. Future versions of BitBake might address this. +\end{itemize} +\end{frame} -- cgit v1.2.3