[bootlin/training-materials updates] master: yocto-recipe-extra: add bb.utils.filter (8ea39419)
Alexandre Belloni
alexandre.belloni at bootlin.com
Fri Mar 19 11:48:48 CET 2021
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/8ea394190f86e247409cc9a48c7dfe99114bb39c
>---------------------------------------------------------------
commit 8ea394190f86e247409cc9a48c7dfe99114bb39c
Author: Alexandre Belloni <alexandre.belloni at bootlin.com>
Date: Fri Mar 19 11:48:48 2021 +0100
yocto-recipe-extra: add bb.utils.filter
Also explain DISTRO_FEATURES and COMBINED_FEATURES
Signed-off-by: Alexandre Belloni <alexandre.belloni at bootlin.com>
>---------------------------------------------------------------
8ea394190f86e247409cc9a48c7dfe99114bb39c
slides/yocto-layer-distro/yocto-layer-distro.tex | 11 +++++++++++
slides/yocto-recipe-extra/yocto-recipe-extra.tex | 11 +++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/slides/yocto-layer-distro/yocto-layer-distro.tex b/slides/yocto-layer-distro/yocto-layer-distro.tex
index b5afc1a0..28994428 100644
--- a/slides/yocto-layer-distro/yocto-layer-distro.tex
+++ b/slides/yocto-layer-distro/yocto-layer-distro.tex
@@ -61,6 +61,17 @@ MAINTAINER = "..."
\end{block}
\end{frame}
+\begin{frame}
+ \frametitle{\code{DISTRO_FEATURES}}
+ \begin{itemize}
+ \item Lists the features the distribution will provide.
+ \item As for \code{MACHINE_FEATURES}, this is used by package
+ recipes to enable or disable functionalities.
+ \item \code{COMBINED_FEATURES} provides the list of features that
+ are enabled in both \code{MACHINE_FEATURES} and \code{DISTRO_FEATURES}.
+ \end{itemize}
+\end{frame}
+
\begin{frame}
\frametitle{Toolchain selection}
\begin{itemize}
diff --git a/slides/yocto-recipe-extra/yocto-recipe-extra.tex b/slides/yocto-recipe-extra/yocto-recipe-extra.tex
index 5d1aa7fd..3054e789 100644
--- a/slides/yocto-recipe-extra/yocto-recipe-extra.tex
+++ b/slides/yocto-recipe-extra/yocto-recipe-extra.tex
@@ -66,13 +66,16 @@ PACKAGECONFIG[openvpn] = "--enable-openvpn, \
falseval, d)}: if \code{checkval} is found in
\code{variable}, \code{trueval} is returned; otherwise
\code{falseval} is used.
+ \item \code{bb.utils.filter(variable, checkvalues, d)}: returns
+ all the words in the variable that are present in the
+ checkvalues.
\item Example:
\begin{block}{}
\begin{minted}[fontsize=\small]{sh}
-PACKAGECONFIG ??= " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wifi', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth','bluetooth', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', '3g','3g', '', d)}"
+PACKAGECONFIG ??= "wispr iptables client\
+ ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+"
\end{minted}
\end{block}
\end{itemize}
More information about the training-materials-updates
mailing list