Skip to content

Commit

Permalink
yocto: slides: move earlier and expand some basic recipe debugging tools
Browse files Browse the repository at this point in the history
Move 'bitbake -e', 'bitbake-getvar -r' and the log+run files to
yocto-recipe-basics since these are really useful especially when starting
writing recipes, and in the corresponding lab.

Also expand both sections.

Signed-off-by: Luca Ceresoli <[email protected]>
  • Loading branch information
lucaceresoli committed Feb 2, 2024
1 parent a5a8572 commit be9ea02
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 31 deletions.
33 changes: 2 additions & 31 deletions slides/yocto-recipe-advanced/yocto-recipe-advanced.tex
Original file line number Diff line number Diff line change
Expand Up @@ -351,39 +351,10 @@ \subsection{BitBake file inclusions}
\end{itemize}
\end{frame}
\subsection{Debugging recipes}
\subsection{More recipe debugging tools}
\begin{frame}[fragile]
\frametitle{Debugging recipes}
\begin{itemize}
\item For each task, logs are available in the \code{temp}
directory in the work folder of a recipe. This includes both
the actual tasks code that ran and the output of the task.
\item \code{bitbake} can dump the whole environment, including the
variable values and how they were set:
\begin{block}{}
\begin{minted}[fontsize=\tiny]{console}
$ bitbake -e ninvaders
# $DEPENDS [4 operations]
# set /yocto-labs/poky/meta/conf/bitbake.conf:268
# ""
# set /yocto-labs/poky/meta/conf/documentation.conf:130
# [doc] "Lists a recipe's build-time dependencies (i.e. other recipe files)."
# :prepend /yocto-training/yocto-labs/poky/meta/classes/base.bbclass:74
# "${BASEDEPENDS} "
# set /yocto-labs/meta-bootlinlabs/recipes-games/ninvaders/ninvaders.inc:11
# "ncurses"
# pre-expansion value:
# "${BASEDEPENDS} ncurses"
DEPENDS="virtual/arm-poky-linux-gnueabi-gcc virtual/arm-poky-linux-gnueabi-compilerlibs virtual/libc ncurses"
\end{minted}
\end{block}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Debugging recipes}
\frametitle{More recipe debugging tools}
\begin{itemize}
\item A development shell, exporting the full environment can be
used to debug build failures:
Expand Down
38 changes: 38 additions & 0 deletions slides/yocto-recipe-basics/yocto-recipe-basics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -586,3 +586,41 @@ \subsection{Example of a recipe with a version agnostic part}
\end{minted}
\end{block}
\end{frame}
\subsection{Debugging recipes}
\begin{frame}
\frametitle{Log and run files}
\begin{itemize}
\item For each task, these files are generated in the \code{temp}
directory under the recipe work directory
\item \code{run.do_<taskname>}
\begin{itemize}
\item the script generated from the recipe content and executed to
run the task
\end{itemize}
\item \code{log.do_<taskname>}
\begin{itemize}
\item the output of the task execution
\end{itemize}
\item These can be inspected to understand what is being done by the
tasks
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Debugging variable assignment}
\begin{itemize}
\item \code{bitbake-getvar} can dump the per-recipe variable value
using the \code{-r} option
\begin{itemize}
\item \code{bitbake-getvar -r ncurses SRC_URI}
\end{itemize}
\item Similarly, \code{bitbake -e} dumps the entire environment, and
also the task code
\begin{itemize}
\item \code{bitbake -e}
\item \code{bitbake -e ncurses}
\end{itemize}
\end{itemize}
\end{frame}

0 comments on commit be9ea02

Please sign in to comment.