[FE training-materials-updates] Convert the buildroot labs to building the alsa apps
Maxime Ripard
maxime.ripard at free-electrons.com
Thu Jul 17 15:33:15 CEST 2014
Repository : git://git.free-electrons.com/training-materials.git
On branch : sysdev-xplained
Link : http://git.free-electrons.com/training-materials/commit/?id=9419ced8cf6ebd16e38dfe3f794638017adcfc92
>---------------------------------------------------------------
commit 9419ced8cf6ebd16e38dfe3f794638017adcfc92
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date: Wed Jul 16 17:24:53 2014 +0200
Convert the buildroot labs to building the alsa apps
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
>---------------------------------------------------------------
9419ced8cf6ebd16e38dfe3f794638017adcfc92
labs/sysdev-buildroot/sysdev-buildroot.tex | 81 +++++++++++++---------------
1 file changed, 37 insertions(+), 44 deletions(-)
diff --git a/labs/sysdev-buildroot/sysdev-buildroot.tex b/labs/sysdev-buildroot/sysdev-buildroot.tex
index a39d249..f748e0b 100644
--- a/labs/sysdev-buildroot/sysdev-buildroot.tex
+++ b/labs/sysdev-buildroot/sysdev-buildroot.tex
@@ -1,7 +1,7 @@
\subchapter{Using a build system, example with Buildroot}{Objectives:
discover how a build system is used and how it works, with the
example of the Buildroot build system. Build a Linux system with
- libraries and make it work inside Qemu.}
+ libraries and make it work on the board.}
\section{Setup}
@@ -52,10 +52,9 @@ In our case, we would like to:
\item Generate an embedded Linux system for ARM;
\item Use an already existing external toolchain instead of having
Buildroot generating one for us;
-\item Integrate Busybox, DirectFB and DirectFB sample applications in
- our embedded Linux system;
-\item Integrate the target filesystem into both an ext2 filesystem
- image and a tarball
+\item Integrate Busybox, alsa-utils and vorbis-tools in our embedded
+ Linux system;
+\item Integrate the target filesystem into a tarball
\end{itemize}
To run the configuration utility of Buildroot, simply run:
@@ -68,9 +67,7 @@ Set the following options:
\begin{itemize}
\item \code{Target Architecture}: \code{ARM (little endian)}
-\item \code{Target Architecture Variant}: \code{arm926t} (we will start booting
- the generated filesystem on an emulated arm9 based system,
- instead of the IGEPv2 board)
+\item \code{Target Architecture Variant}: \code{cortex-A5}
\item \code{Toolchain}
\begin{itemize}
\item \code{Toolchain type}: \code{External toolchain}
@@ -83,28 +80,23 @@ Set the following options:
RPC support?}, and \code{Toolchain has C++ support?}.
Buildroot will check these parameters anyway.
\end{itemize}
-\item \code{System configuration}
- \begin{itemize}
- \item \code{Port to run a getty (login prompt) on}: change \code{ttyS0} to \code{tty1}
- \end{itemize}
\item \code{Target packages}
\begin{itemize}
\item Keep \code{BusyBox} (default version) and keep the Busybox
configuration proposed by Buildroot;
- \item \code{In Graphic libraries and applications (graphic/text)}
+ \item \code{Audio and video applications}
\begin{itemize}
- \item Select \code{directfb}. Buildroot will automatically select the
- necessary dependencies.
+ \item Select \code{alsa-utils}
+ \item \code{ALSA utils selection}
\begin{itemize}
- \item Remove \code{enable touchscreen support}
- \item Select \code{directfb examples}
- \item Select all the DirectFB examples
+ \item Select alsactl
+ \item Select alsamixer
+ \item Select speaker-test
\end{itemize}
\end{itemize}
\end{itemize}
\item \code{Filesystem images}
\begin{itemize}
- \item Select \code{ext2/3/4 root filesystem}
\item Select \code{tar the root filesystem}
\end{itemize}
\end{itemize}
@@ -141,12 +133,9 @@ explore its contents:
makedevs, fakeroot)
\item \code{images}, which contains the final images produced by
- Buildroot. In our case it's just an ext2 filesystem image and a
- tarball of the filesystem, but depending on the Buildroot
- configuration, there could also be a kernel image or a bootloader
- image. This is where we find \code{rootfs.tar} and
- \code{rootfs.ext2}, which are respectively the tarball and the ext2
- image of the generated root filesystem.
+ Buildroot. In our case it's just a tarball of the filesystem, called
+ \code{rootfs.tar}, but depending on the Buildroot configuration,
+ there could also be a kernel image or a bootloader image.
\item \code{staging}, which contains the âbuildâ space of the target
system. All the target libraries, with headers, documentation. It
@@ -168,36 +157,40 @@ explore its contents:
\section{Run the generated system}
-If you didn't do it in the previous lab, install QEMU emulator for non
-x86 targets:
+Go back to the \code{$HOME/felabs/sysdev/buildroot/} directory. Create
+a new directory \code{system} that is going to hold our system,
+exported over NFS. Go into this directory, and untar the rootfs using:
\begin{verbatim}
-sudo apt-get install qemu-kvm-extras
+sudo tar -xvf ../buildroot/output/images/rootfs.tar
\end{verbatim}
-We will use the kernel image in \code{data} and the filesystem image
-generated by Buildroot in the ext2 format to boot the generated system
-in QEMU. We start by using a QEMU emulated ARM board with display
-support, allowing to test graphical applications relying on the
-DirectFB library. Later, we will be able move to a real board if your
-hardware also has a graphical display.
+Add our \code{system} directory to the list of the directory exported
+by NFS in \code{/etc/exports}, and make sure the board use it too.
-Execute the \code{run_qemu} script, which contains what's needed
-to boot the system in QEMU.
+Boot the board, and log in (\code{root} account, no password).
-Log in (\code{root} account, no password), and run demo programs:
-
-\begin{verbatim}
-df_andi
-df_dok
-df_fire
-...
-\end{verbatim}
+You should now have a shell, where you will be able to run
+\code{speaker-test} and \code{ogg123} like you used to in the previous
+lab.
\section{Going further}
\begin{itemize}
+\item Flash the new system on the flash of the board
+ \begin{itemize}
+ \item First, in buildroot, select the JFFS2 filesystem image type.
+ \item You'll also need to provide buildroot some informations on the
+ underlying device that will store the filesystem. In our case, we
+ will store it on a NAND, with pages 2kB wide, and with an erase
+ size of 128kB.
+ \item We'll also need to pad the output to the end of the next erase
+ block
+ \item Then, once the image has been generated, flash it on your
+ board.
+ \end{itemize}
+
\item Add dropbear (SSH server and client) to the list of packages
built by Buildroot, add the network emulation in QEMU (see the
\code{../thirdparty/run_qemu} script for an example), and log to
More information about the training-materials-updates
mailing list