[FE training-materials-updates] buildroot/slides: various fixes and improvements
Boris Brezillon
boris.brezillon at free-electrons.com
Fri May 22 17:12:38 CEST 2015
Repository : git://git.free-electrons.com/training-materials.git
On branch : mtd-rework-WIP
Link : http://git.free-electrons.com/training-materials/commit/?id=ab161c23ba103dc5f3656faacdf24634fb0d90d5
>---------------------------------------------------------------
commit ab161c23ba103dc5f3656faacdf24634fb0d90d5
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date: Tue May 12 11:36:11 2015 +0200
buildroot/slides: various fixes and improvements
This commit implements a number of fixes and improvements suggested by
Arnout Vandecappelle.
Suggested-by: Arnout Vandecappelle <arnout at mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
>---------------------------------------------------------------
ab161c23ba103dc5f3656faacdf24634fb0d90d5
.../buildroot-advanced-packages.tex | 8 ++--
slides/buildroot-build/buildroot-build.tex | 12 +++--
slides/buildroot-download/buildroot-download.tex | 6 ++-
.../buildroot-introduction.tex | 56 ++++++++++++++++------
slides/buildroot-kernel/buildroot-kernel.tex | 3 +-
slides/buildroot-make/buildroot-make.tex | 7 ++-
.../buildroot-new-packages.tex | 8 ++--
slides/buildroot-rootfs/buildroot-rootfs.tex | 19 ++++++--
slides/buildroot-toolchain/buildroot-toolchain.tex | 4 +-
slides/buildroot-tree/buildroot-tree.tex | 6 +++
10 files changed, 92 insertions(+), 37 deletions(-)
diff --git a/slides/buildroot-advanced-packages/buildroot-advanced-packages.tex b/slides/buildroot-advanced-packages/buildroot-advanced-packages.tex
index afba4ca..5063077 100644
--- a/slides/buildroot-advanced-packages/buildroot-advanced-packages.tex
+++ b/slides/buildroot-advanced-packages/buildroot-advanced-packages.tex
@@ -52,8 +52,8 @@ $ make legal-info
\begin{itemize}
\item Comma-separated {\bf list of license(s)} under which the
package is distributed.
- \item Free form string, but should use the license codes from
- \url{https://spdx.org/licenses/}
+ \item Free form string, but should if possible use the license
+ codes from \url{https://spdx.org/licenses/}
\item Can indicate which part is under which license (programs,
tests, libraries, etc.)
\end{itemize}
@@ -66,9 +66,11 @@ $ make legal-info
\end{itemize}
\item \code{<pkg>_REDISTRIBUTE}
\begin{itemize}
- \item Boolean indicating whether the package source code should be
+ \item Boolean indicating whether the package source code can be
redistributed or not (part of the \code{legal-info} output)
\item Defaults to \code{YES}, can be overriden to \code{NO}
+ \item If \code{NO}, source code is not copied when generating the
+ licensing report
\end{itemize}
\end{itemize}
\end{frame}
diff --git a/slides/buildroot-build/buildroot-build.tex b/slides/buildroot-build/buildroot-build.tex
index a957013..1c195b4 100644
--- a/slides/buildroot-build/buildroot-build.tex
+++ b/slides/buildroot-build/buildroot-build.tex
@@ -272,7 +272,7 @@ BR2_PACKAGE_LIBCONFIG=y
\begin{frame}[fragile]{Assembling a {\em defconfig} (1/2)}
\begin{block}{debug.frag}
- {\small
+ {\scriptsize
\begin{verbatim}
BR2_ENABLE_DEBUG=y
BR2_PACKAGE_STRACE=y
@@ -281,9 +281,10 @@ BR2_PACKAGE_STRACE=y
\end{block}
\begin{block}{Build a release system for {\em platform1}}
- {\small
+ {\scriptsize
\begin{verbatim}
-$ cat platform1.frag packages.frag > .config
+$ ./support/kconfig/merge_config.sh platform1.frag packages.frag > \
+ .config
$ make olddefconfig
$ make
\end{verbatim}
@@ -291,9 +292,10 @@ $ make
\end{block}
\begin{block}{Build a debug system for {\em platform2}}
- {\small
+ {\scriptsize
\begin{verbatim}
-$ cat platform2.frag packages.frag debug.frag > .config
+$ ./support/kconfig/merge_config.sh platform2.frag packages.frag \
+ debug.frag > .config
$ make olddefconfig
$ make
\end{verbatim}
diff --git a/slides/buildroot-download/buildroot-download.tex b/slides/buildroot-download/buildroot-download.tex
index e40a190..08ace7e 100644
--- a/slides/buildroot-download/buildroot-download.tex
+++ b/slides/buildroot-download/buildroot-download.tex
@@ -77,7 +77,8 @@
\item Can be changed
\begin{itemize}
\item using the \code{BR2_DL_DIR} configuration option
- \item or by passing the \code{BR2_DL_DIR} environment variable
+ \item or by passing the \code{BR2_DL_DIR} environment variable,
+ which overrides the config option of the same name
\end{itemize}
\item The download mechanism is written in a way that allows
independent parallel builds to share the same \code{DL_DIR} (using
@@ -100,7 +101,8 @@
\begin{itemize}
\item Example: \code{avrdude-eabe067c4527bc2eedc5db9288ef5cf1818ec720.tar.gz}
\end{itemize}
- \item This tarball will be re-used for the next builds.
+ \item This tarball will be re-used for the next builds, and attempts
+ are made to download it from the primary and backup sites.
\item Due to this, always use a tag name or a full commit id, and
never a branch name: the code will never be re-downloaded when the
branch is updated.
diff --git a/slides/buildroot-introduction/buildroot-introduction.tex b/slides/buildroot-introduction/buildroot-introduction.tex
index 96e90e5..ce2edf9 100644
--- a/slides/buildroot-introduction/buildroot-introduction.tex
+++ b/slides/buildroot-introduction/buildroot-introduction.tex
@@ -31,7 +31,7 @@
\end{frame}
\begin{frame}{System integration: several possibilities}
- \scriptsize
+ \tiny
\begin{tabularx}{11cm}{|X|X|X|}
\hline
& {\bf Pros} & {\bf Cons} \\
@@ -49,11 +49,12 @@
Easy to create and extend
&
Hard to customize \newline
- Hard to optimize \newline
- No way to rebuild the full system from source \newline
+ Hard to optimize (boot time, size) \newline
+ Hard to rebuild the full system from source \newline
Large system \newline
- Usually slow boot \newline
- Uses native compilation \newline
+ Uses native compilation (slow) \newline
+ No well-define mechanism to generate an image \newline
+ Lots of mandatory dependencies \newline
Not available for all architectures \\
\hline
{\bf Build systems} \newline Buildroot, Yocto, PTXdist, etc.
@@ -61,7 +62,9 @@
Nearly full flexibility \newline
Built from source: customization and optimization are easy \newline
Fully reproducible \newline
- Uses cross-compilation
+ Uses cross-compilation \newline
+ Have embedded specific packages not necessarily in desktop distros \newline
+ Make more features optional
&
Not as easy as a binary distribution \newline
Build time \\
@@ -113,6 +116,24 @@
\end{itemize}
\end{frame}
+\begin{frame}{Buildroot design goals}
+ \begin{itemize}
+ \item Buildroot is designed with a few key goals:
+ \begin{itemize}
+ \item Simple to use
+ \item Simple to customize
+ \item Reproducible builds
+ \item Small root filesystem
+ \item Relatively fast boot
+ \item Easy to understand
+ \end{itemize}
+ \item Some of these goals require to not necessarily support all
+ possible features
+ \item They are some more complicated and featureful build systems
+ available (Yocto Project, OpenEmbedded)
+ \end{itemize}
+\end{frame}
+
\begin{frame}{Who's using Buildroot?}
\begin{columns}
\column{0.6\textwidth}
@@ -125,10 +146,10 @@
\end{itemize}
\item {\bf Processor vendors}
\begin{itemize}
- \item Analog Devices
\item Imagination Technologies
\item Marvell
\item Atmel
+ \item Analog Devices
\end{itemize}
\item Many, many {\bf hobbyists} on development boards:
Rasberry Pi, BeagleBone Black, etc.
@@ -150,8 +171,8 @@
\item However, it is generally more convenient to clone the Git
repository
\begin{itemize}
- \item Allows to clearly identify the changes made to the Buildroot
- source code
+ \item Allows to clearly identify the changes you make to the
+ Buildroot source code
\item Simplifies the upstreaming of the Buildroot changes
\item \code{git clone git://git.busybox.net/buildroot}
\item Git tags available for every stable release.
@@ -165,16 +186,16 @@
\begin{itemize}
\item With a few helper shell scripts
\end{itemize}
- \item Interaction always with the main \code{Makefile} in the main
- Buildroot sources directory.
+ \item All interaction by calling \code{make} in the main Buildroot
+ sources directory.
\begin{block}{}
\begin{verbatim}
$ cd buildroot/
$ make help
\end{verbatim}
\end{block}
- \item No need to run as \code{root}, Buildroot is designed to work
- executed with normal user priviledges.
+ \item No need to run as \code{root}, Buildroot is designed to be
+ executed with normal user privileges.
\begin{itemize}
\item Running as root is even strongly discouraged!
\end{itemize}
@@ -183,7 +204,7 @@ $ make help
\begin{frame}{Configuring Buildroot}
\begin{itemize}
- \item Like the Linux kernel, uses {\em kconfig}
+ \item Like the Linux kernel, uses {\em Kconfig}
\item A choice of configuration interfaces:
\begin{itemize}
\item \code{make menuconfig}
@@ -230,6 +251,13 @@ $ make 2>&1 | tee build.log
\item One kernel image, possibly one or several Device Tree blobs
\item One or several bootloader images
\end{itemize}
+ \item There is no standard way to install the images on any given
+ device
+ \begin{itemize}
+ \item Those steps are very device specific
+ \item Buildroot provides some tools for specific platforms (e.g:
+ SAM-BA for Atmel, imx-usb-loader for i.MX6, etc.)
+ \end{itemize}
\end{itemize}
\end{frame}
diff --git a/slides/buildroot-kernel/buildroot-kernel.tex b/slides/buildroot-kernel/buildroot-kernel.tex
index d87dbcd..c79f18a 100644
--- a/slides/buildroot-kernel/buildroot-kernel.tex
+++ b/slides/buildroot-kernel/buildroot-kernel.tex
@@ -10,7 +10,8 @@
done in a special way.
\item Note: while described with the example of the Linux kernel,
this discussion is also valid for other packages using {\em
- kconfig}: \code{barebox}, \code{uclibc}, \code{busybox}.
+ kconfig}: \code{barebox}, \code{uclibc}, \code{busybox} and in
+ the near future, \code{u-boot}.
\end{itemize}
\end{frame}
diff --git a/slides/buildroot-make/buildroot-make.tex b/slides/buildroot-make/buildroot-make.tex
index db67d40..7822046 100644
--- a/slides/buildroot-make/buildroot-make.tex
+++ b/slides/buildroot-make/buildroot-make.tex
@@ -65,8 +65,10 @@ distclean: clean
\begin{itemize}
\item Defining variables is done in different ways:
\begin{itemize}
- \item \code{FOOBAR = value}, a recursively expanded variable
- \item \code{FOOBAR := value}, a simply expanded variable
+ \item \code{FOOBAR = value}, expanded at time of use
+ \item \code{FOOBAR := value}, expanded at time of assignment
+ \item \code{FOOBAR += value}, prepend to the variable, with a
+ separating space, defaults to expanded at the time of use
\item \code{FOOBAR ?= value}, defined only if not already defined
\item Multi-line variables are described using \code{define NAME
... endef}:
@@ -174,6 +176,7 @@ IMAGEMAGICK_CONFIG_SCRIPTS = \
\begin{itemize}
\item Recipes are just shell commands
+ \item Each line must be indented with one \code{Tab}
\item Each line of shell command in a given recipe is independent
from the other: variables are not shared between lines in the
recipe
diff --git a/slides/buildroot-new-packages/buildroot-new-packages.tex b/slides/buildroot-new-packages/buildroot-new-packages.tex
index e83014e..e45d36f 100644
--- a/slides/buildroot-new-packages/buildroot-new-packages.tex
+++ b/slides/buildroot-new-packages/buildroot-new-packages.tex
@@ -24,8 +24,8 @@
describing the configuration options for the package.
\item A \code{<pkg>.mk} file, written in {\em make}, describing where to
fetch the source, how to build and install it, etc.
- \item A \code{<pkg>.hash} file, providing hashes to check the integrity
- of the downloaded tarballs.
+ \item An optional \code{<pkg>.hash} file, providing hashes to check
+ the integrity of the downloaded tarballs.
\item Optionally, \code{.patch} files, that are applied on the
package source code before building.
\item Optionally, any additional file that might be useful for the
@@ -256,7 +256,7 @@ config BR2_PACKAGE_HOST_OPENOCD
help
OpenOCD - Open On-Chip Debugger
- http://openocd.berlios.de/web/
+ http://openocd.org
\end{verbatim}
\end{block}
\end{frame}
@@ -718,7 +718,7 @@ endif
\begin{itemize}
\item Target packages can install files to different locations:
\begin{itemize}
- \item To the {\em target} directory, \code{$(TARGET_DIR}, which is
+ \item To the {\em target} directory, \code{$(TARGET_DIR)}, which is
what will be the target root filesystem.
\item To the {\em staging} directory, \code{$(STAGING_DIR)}, which
is the compiler {\em sysroot}
diff --git a/slides/buildroot-rootfs/buildroot-rootfs.tex b/slides/buildroot-rootfs/buildroot-rootfs.tex
index 5712ce7..242cc8c 100644
--- a/slides/buildroot-rootfs/buildroot-rootfs.tex
+++ b/slides/buildroot-rootfs/buildroot-rootfs.tex
@@ -32,8 +32,8 @@
\begin{frame}{Installation of packages}
\begin{itemize}
- \item All the target packages will be built: Busybox, Qt, OpenSSH,
- and the thousands of other possible packages.
+ \item All the selected target packages will be built (can be
+ Busybox, Qt, OpenSSH, lighttpd, and many more)
\item Most of them will install files in \code{$(TARGET_DIR)}:
programs, libraries, fonts, data files, configuration files, etc.
\item This is really the step that will bring in the root filesystem
@@ -66,8 +66,9 @@
\begin{itemize}
\item To customize the contents of your root filesystem, to add
- configuration files, scripts or any other file, one possible
- solution is to use a {\bf root filesystem overlay}.
+ configuration files, scripts, symbolic links, directories or any
+ other file, one possible solution is to use a {\bf root filesystem
+ overlay}.
\item A {\em root filesystem overlay} is simply a directory whose
contents will be {\bf copied over the root filesystem}, after all
@@ -261,6 +262,16 @@ test 8000 wheel -1 = - /bin/sh - Test u
\end{itemize}
\item \code{BR2_ROOTFS_POST_IMAGE_SCRIPT} is a space-separated list
of {\em post-image} scripts to call.
+ \item Post-image scripts are called:
+ \begin{itemize}
+ \item from the Buildroot source directory
+ \item with the \code{$(IMAGES_DIR}) path as first argument
+ \item with the contents of the \code{BR2_ROOTFS_POST_SCRIPT_ARGS} as other arguments
+ \item with a number of available environment variables:
+ \code{BR2_CONFIG}, \code{HOST_DIR}, \code{STAGING_DIR},
+ \code{TARGET_DIR}, \code{BUILD_DIR}, \code{BINARIES_DIR} and
+ \code{BASE_DIR}.
+ \end{itemize}
\end{itemize}
\end{frame}
diff --git a/slides/buildroot-toolchain/buildroot-toolchain.tex b/slides/buildroot-toolchain/buildroot-toolchain.tex
index cc60b4d..256bc51 100644
--- a/slides/buildroot-toolchain/buildroot-toolchain.tex
+++ b/slides/buildroot-toolchain/buildroot-toolchain.tex
@@ -127,8 +127,8 @@
configuration of the toolchain: C library, kernel headers version,
etc.
\begin{itemize}
- \item Buildroot needs these informations to know which packages
- can be built with this toolchain
+ \item Buildroot needs this information to know which packages can
+ be built with this toolchain
\item Buildroot will check those values at the beginning of the
build
\end{itemize}
diff --git a/slides/buildroot-tree/buildroot-tree.tex b/slides/buildroot-tree/buildroot-tree.tex
index c2a66ed..28c67e3 100644
--- a/slides/buildroot-tree/buildroot-tree.tex
+++ b/slides/buildroot-tree/buildroot-tree.tex
@@ -108,6 +108,7 @@
\code{make manual}
\item ~90 pages PDF document
\item Also available pre-generated online.
+ \item \url{http://buildroot.org/downloads/manual/manual.html}
\end{itemize}
\end{itemize}
\end{frame}
@@ -167,6 +168,9 @@
\item Variable: \code{HOST_DIR}
\item Host tools are directly in \code{host/usr}
\item The {\em sysroot} is in \code{host/<tuple>/sysroot/usr}
+ \item \code{<tuple>} is an identifier of the architecture, vendor,
+ operating system, C library and ABI. E.g:
+ \code{arm-unknown-linux-gnueabihf}.
\item Variable for the {\em sysroot}: \code{STAGING_DIR}
\end{itemize}
\end{itemize}
@@ -243,6 +247,8 @@
\item \code{make graph-depends}
\item \code{make graph-build}
\item Variable: \code{GRAPHS_DIR}
+ \item See the section {\em Analyzing the build} later in this
+ training.
\end{itemize}
\end{itemize}
\end{frame}
More information about the training-materials-updates
mailing list