[bootlin/training-materials updates] master: yocto: slides: clarify FILESPATH (6a61648c)
Luca Ceresoli
luca.ceresoli at bootlin.com
Tue May 9 16:15:34 CEST 2023
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/6a61648c78fa521d4e60f00c0def84453a12b4d8
>---------------------------------------------------------------
commit 6a61648c78fa521d4e60f00c0def84453a12b4d8
Author: Luca Ceresoli <luca.ceresoli at bootlin.com>
Date: Tue May 9 16:15:34 2023 +0200
yocto: slides: clarify FILESPATH
Remove details about how it is implemented and explain the idea, step by
step. Also mention the possibility to use a different file per-MACHINE with
an example.
Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
>---------------------------------------------------------------
6a61648c78fa521d4e60f00c0def84453a12b4d8
slides/yocto-recipe-basics/file-overrides.dia | Bin 0 -> 877 bytes
slides/yocto-recipe-basics/yocto-recipe-basics.tex | 93 +++++++++++++++++----
2 files changed, 75 insertions(+), 18 deletions(-)
diff --git a/slides/yocto-recipe-basics/file-overrides.dia b/slides/yocto-recipe-basics/file-overrides.dia
new file mode 100644
index 00000000..a229fad1
Binary files /dev/null and b/slides/yocto-recipe-basics/file-overrides.dia differ
diff --git a/slides/yocto-recipe-basics/yocto-recipe-basics.tex b/slides/yocto-recipe-basics/yocto-recipe-basics.tex
index be4e6735..dd54087b 100644
--- a/slides/yocto-recipe-basics/yocto-recipe-basics.tex
+++ b/slides/yocto-recipe-basics/yocto-recipe-basics.tex
@@ -178,31 +178,88 @@ SRC_URI[patch.md5sum] = "b184acf9eb39df794ffd..."
\end{block}
\end{frame}
-\begin{frame}[fragile]
+\begin{frame}
\frametitle{The source locations: local files}
\begin{itemize}
- \item All local files found in \code{SRC_URI} are copied into the
- recipe's working directory, in \code{$BUILDDIR/tmp/work/}.
+ \item \code{SRC_URI} items using the \code{file://} scheme are {\em
+ local files}
+ \item They are not downloaded, but rather copied from the layer to the
+ work directory
\item The searched paths are defined in the \code{FILESPATH}
- variable.
+ variable
+ \item \code{FILESPATH} is a colon-separated list of paths to look for
+ files
+ \item The order matters: when a file is found in a paths, the search
+ ends
\end{itemize}
- \begin{block}{}
- \begin{minted}{sh}
-FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}",
- "${FILE_DIRNAME}/${BPN}","${FILE_DIRNAME}/files"], d)}
+\end{frame}
-FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:
- ${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
- \end{minted}
- \end{block}
+\begin{frame}
+ \frametitle{\code{FILESPATH} 1/3}
+ \begin{itemize}
+ \item \code{FILESPATH} is generated with all combinations of:
+ \item Base paths
+ \begin{itemize}
+ \item \code{${FILE_DIRNAME}/${BP}} (e.g. \code{BP} = \code{dropbear-2020.81})
+ \item \code{${FILE_DIRNAME}/${BPN}} (e.g. \code{BPN} = \code{dropbear})
+ \item \code{${FILE_DIRNAME}/files}
+ \item Items in \code{FILESEXTRAPATHS} (none by default)
+ \item \code{${FILE_DIRNAME}} is the directory containing the \code{.bb} file
+ \end{itemize}
+ \item The overrides in \code{FILESOVERRIDES}
+ \begin{itemize}
+ \item Set as \code{${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}}
+ \item E.g. \code{arm:armv7a:ti-soc:ti33x:beaglebone:poky}
+ \item Applied right to left
+ \end{itemize}
+ \end{itemize}
+\end{frame}
+
+\begin{frame}
+ \frametitle{\code{FILESPATH} 2/3}
+ \begin{itemize}
+ \item This results in a long list, including:
+ \begin{itemize}
+ {\scriptsize
+ \item \code{/.../meta/recipes-core/dropbear/dropbear-2020.81/poky}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear/poky}
+ \item \code{/.../meta/recipes-core/dropbear/files/poky}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear-2020.81/beaglebone}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear/beaglebone}
+ \item \code{/.../meta/recipes-core/dropbear/files/beaglebone}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear-2020.81/ti33x}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear/ti33x}
+ \item \code{/.../meta/recipes-core/dropbear/files/ti33x}
+ \item\dots
+ \item \code{/.../meta/recipes-core/dropbear/dropbear-2020.81/armv7a}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear/armv7a}
+ \item \code{/.../meta/recipes-core/dropbear/files/armv7a}
+ \item\dots
+ \item \code{/.../meta/recipes-core/dropbear/dropbear-2020.81/}
+ \item \code{/.../meta/recipes-core/dropbear/dropbear/}
+ \item \code{/.../meta/recipes-core/dropbear/files/}
+ }
+ \end{itemize}
+ \end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{\code{FILESPATH} 3/3}
\begin{itemize}
- \item The \code{base_set_filespath(path)} function uses its
- \code{path} parameter, \code{FILESEXTRAPATHS} and
- \code{FILESOVERRIDES} to fill the \code{FILESPATH} variable.
- \item Custom paths and files can be added using
- \code{FILESEXTRAPATHS} and \code{FILESOVERRIDES}.
- \item Prepend the paths, as the order matters.
+ \item This complex logic allows to use different files without
+ conditional code
+ \item Example: with a single item in \code{SRC_URI}:
+ \begin{block}{}
+ \begin{minted}{sh}
+SRC_URI += "file://defconfig"
+ \end{minted}
+ \end{block}
+ a different \code{defconfig} can be used for different MACHINE
+ values:
\end{itemize}
+ \begin{center}
+ \includegraphics[width=0.7\textwidth]{slides/yocto-recipe-basics/file-overrides.pdf}
+ \end{center}
\end{frame}
\begin{frame}
More information about the training-materials-updates
mailing list