[FE training-materials-updates] yocto: slides: add a part about file inclusions

Antoine Ténart antoine.tenart at free-electrons.com
Wed Sep 7 11:49:15 CEST 2016

Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=fa6a8eb04ff35f8a3a318cd44acc959eadbc4f6f


commit fa6a8eb04ff35f8a3a318cd44acc959eadbc4f6f
Author: Antoine Tenart <antoine.tenart at free-electrons.com>
Date:   Wed Sep 7 11:49:15 2016 +0200

    yocto: slides: add a part about file inclusions
    Signed-off-by: Antoine Tenart <antoine.tenart at free-electrons.com>


 .../yocto-recipe-advanced.tex                      | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/slides/yocto-recipe-advanced/yocto-recipe-advanced.tex b/slides/yocto-recipe-advanced/yocto-recipe-advanced.tex
index a42c9b3..98db0f2 100644
--- a/slides/yocto-recipe-advanced/yocto-recipe-advanced.tex
+++ b/slides/yocto-recipe-advanced/yocto-recipe-advanced.tex
@@ -317,6 +317,54 @@ do_install() {
+\subsection{BitBake file inclusions}
+  \frametitle{Locate files in the build system}
+  \begin{itemize}
+    \item Metadata can be shared using included files.
+    \item \code{BitBake} uses the \code{BBPATH} to find the files to
+      be included. It also looks into the current directory.
+    \item Three keywords can be used to include files from recipes,
+      classes or other configuration files:
+      \begin{itemize}
+        \item \code{inherit}
+        \item \code{include}
+        \item \code{require}
+      \end{itemize}
+  \end{itemize}
+  \frametitle{The \code{inherit} keyword}
+  \begin{itemize}
+    \item \code{inherit} can be used in recipes or classes, to inherit
+      the functionalities of a class.
+    \item To inherit the functionalities of the \code{kernel} class,
+      use: \code{inherit kernel}
+    \item \code{inherit} looks for files ending in \code{.bbclass}, in
+      \code{classes} directories found in \code{BBPATH}.
+    \item It is possible to include a class conditionally using a
+      variable: \code{inherit ${FOO}}
+  \end{itemize}
+  \frametitle{The \code{include} and \code{require} keywords}
+  \begin{itemize}
+    \item \code{include} and \code{require} can be used in all files,
+      to insert the content of another file at that location.
+    \item If the path specified on the \code{include} (or
+      \code{require}) path is relative, BitBake will insert the first
+      file found in \code{BBPATH}.
+    \item \code{include} does not produce an error when a file cannot
+      be found, whereas \code{require} raises a parsing error.
+    \item To include a local file: \code{include ninvaders.inc}
+    \item To include a file from another location (which could be
+      in another layer): \code{include path/to/file.inc}
+  \end{itemize}
 \subsection{Debugging recipes}

More information about the training-materials-updates mailing list