[FE training-materials-updates] buildroot slides: misc improvements

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed May 6 11:36:34 CEST 2015


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=e2d113810840014ba16c044a20f77fe3b46a65ae

>---------------------------------------------------------------

commit e2d113810840014ba16c044a20f77fe3b46a65ae
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Wed May 6 11:35:39 2015 +0200

    buildroot slides: misc improvements
    
    This commit implements misc improvements and fixes suggested by Peter
    Korsgaard.
    
    Suggested-by: Peter Korsgaard <peter at korsgaard.com>
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


>---------------------------------------------------------------

e2d113810840014ba16c044a20f77fe3b46a65ae
 labs/buildroot-basic/buildroot-basic.tex           |  2 +-
 slides/buildroot-build/buildroot-build.tex         | 47 +++++++++--------
 slides/buildroot-download/buildroot-download.tex   | 26 +++++++++
 .../buildroot-introduction.tex                     |  4 +-
 .../buildroot-new-packages.tex                     | 61 +++++++++++++---------
 slides/buildroot-rootfs/buildroot-rootfs.tex       |  5 +-
 slides/buildroot-tree/buildroot-tree.tex           |  2 +-
 7 files changed, 95 insertions(+), 52 deletions(-)

diff --git a/labs/buildroot-basic/buildroot-basic.tex b/labs/buildroot-basic/buildroot-basic.tex
index dc18d95..33591e7 100644
--- a/labs/buildroot-basic/buildroot-basic.tex
+++ b/labs/buildroot-basic/buildroot-basic.tex
@@ -180,7 +180,7 @@ Now, let's do the configuration:
   \end{itemize}
 
 \item \code{Target packages} menu. This is probably the most important
-  menu, as this is the one where you can select amongst the 1500
+  menu, as this is the one where you can select amongst the 1600+
   available Buildroot packages which ones should be built and
   installed in your system. For our basic system, enabling
   \code{Busybox} is sufficient, but feel free to explore the available
diff --git a/slides/buildroot-build/buildroot-build.tex b/slides/buildroot-build/buildroot-build.tex
index 660a3ee..c67ccfc 100644
--- a/slides/buildroot-build/buildroot-build.tex
+++ b/slides/buildroot-build/buildroot-build.tex
@@ -1,3 +1,5 @@
+\setbeamerfont{block title}{size=\scriptsize}
+
 \section{Managing the build and the configuration}
 
 \begin{frame}{Default build organization}
@@ -194,6 +196,8 @@ BR2_PACKAGE_STRESS=y
     \item By default, saved as \code{defconfig}.
     \item Can be customized using \code{BR2_DEFCONFIG} configuration
       option (can also be passed in the environment)
+    \item Move it to \code{configs/} to make it easily loadable with
+      \code{make <foo>_defconfig}.
     \end{itemize}
   \end{itemize}
 \end{frame}
@@ -239,38 +243,37 @@ BR2_PACKAGE_LIBCONFIG=y
 
 \begin{frame}[fragile]{Assembling a {\em defconfig} (1/2)}
 
-{\small
-   \begin{block}{debug.frag}
+  \begin{block}{debug.frag}
+    {\small
 \begin{verbatim}
 BR2_ENABLE_DEBUG=y
 BR2_PACKAGE_STRACE=y
 \end{verbatim}
-   \end{block}
-}
+    }
+  \end{block}
 
-\begin{itemize}
-
-  \item Build a release system for {\em platform1}:
-{\small
-    \begin{block}{}
+  \begin{block}{Build a release system for {\em platform1}}
+    {\small
 \begin{verbatim}
-$ cat platform1.frag packages.frag > configs/foo_defconfig
-$ make foo_defconfig && make
+$ cat platform1.frag packages.frag > .config
+$ make olddefconfig
+$ make
 \end{verbatim}
-    \end{block}{}
-}
-  \item Build a debug system for {\em platform2}:
-{\small
-    \begin{block}{}
+    }
+  \end{block}
+
+  \begin{block}{Build a debug system for {\em platform2}}
+    {\small
 \begin{verbatim}
-$ cat platform2.frag packages.frag debug.frag > \
-        configs/foo_defconfig
-$ make foo_defconfig && make
+$ cat platform2.frag packages.frag debug.frag > .config
+$ make olddefconfig
+$ make
 \end{verbatim}
-    \end{block}
-}
+    }
+  \end{block}
 
-\end{itemize}
+  Note: \code{olddefconfig} expands a minimal {\em defconfig} to a full
+  \code{.config}.
 
 \end{frame}
 
diff --git a/slides/buildroot-download/buildroot-download.tex b/slides/buildroot-download/buildroot-download.tex
index 04b8302..e40a190 100644
--- a/slides/buildroot-download/buildroot-download.tex
+++ b/slides/buildroot-download/buildroot-download.tex
@@ -101,9 +101,35 @@
     \item Example: \code{avrdude-eabe067c4527bc2eedc5db9288ef5cf1818ec720.tar.gz}
     \end{itemize}
   \item This tarball will be re-used for the next builds.
+  \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.
   \end{itemize}
 \end{frame}
 
+\begin{frame}[fragile]{File integrity checking}
+  \begin{itemize}
+  \item Buildroot packages can provide a \code{.hash} file to provide
+    {\em hashes} for the downloaded files.
+  \item The download infrastructure uses this hash file when available
+    to check the integrity of the downloaded files.
+  \item Hashs are checked every time a downloaded file is used, even
+    if it is already cached in \code{$(DL_DIR)}.
+  \item If the hash is incorrect, the download infrastructure attempts
+    to re-download the file once. If that still fails, the build
+    aborts with an error.
+  \end{itemize}
+
+  \begin{block}{Hash checking message}
+{\scriptsize
+\begin{verbatim}
+strace-4.10.tar.xz: OK (md5: 107a5be455493861189e9b57a3a51912)
+strace-4.10.tar.xz: OK (sha1: 5c3ec4c5a9eeb440d7ec70514923c2e7e7f9ab6c)
+>>> strace 4.10 Extracting
+\end{verbatim}}
+  \end{block}
+\end{frame}
+
 \begin{frame}{Download-related {\tt make} targets}
   \begin{itemize}
   \item \code{make source}
diff --git a/slides/buildroot-introduction/buildroot-introduction.tex b/slides/buildroot-introduction/buildroot-introduction.tex
index c520955..f1cd5d4 100644
--- a/slides/buildroot-introduction/buildroot-introduction.tex
+++ b/slides/buildroot-introduction/buildroot-introduction.tex
@@ -15,7 +15,7 @@
 \begin{frame}{Embedded Linux work}
   \begin{itemize}
   \item {\bf BSP work}: porting the bootloader and Linux kernel,
-    developping Linux device drivers.
+    developing Linux device drivers.
   \item {\bf system integration work}: assembling all the userspace
     components needed for the system, configure them, develop the
     upgrade and recovery mechanisms, etc.
@@ -104,7 +104,7 @@
   \item {\bf Fast}: builds a simple root filesystem in a few minutes
   \item Easy to understand: written in make, extensive documentation
   \item {\bf Small} root filesystem, starting at 2 MB
-  \item More than {\bf 1500 packages} for userspace libraries/apps available
+  \item {\bf 1600+ packages} for userspace libraries/apps available
   \item {\bf Many architectures} supported
   \item {\bf Well-known technologies} : {\em make} and {\em kconfig}
   \item Vendor neutral
diff --git a/slides/buildroot-new-packages/buildroot-new-packages.tex b/slides/buildroot-new-packages/buildroot-new-packages.tex
index d354198..5d8cccc 100644
--- a/slides/buildroot-new-packages/buildroot-new-packages.tex
+++ b/slides/buildroot-new-packages/buildroot-new-packages.tex
@@ -107,7 +107,8 @@ endmenu
     \begin{itemize}
     \item \code{depends on} for architecture, toolchain feature, or
       {\em big} feature dependencies. E.g: package only available on
-      x86, or only if IPv6 is enabled, or depends on Python.
+      x86, or only if wide char support is enabled, or depends on
+      Python.
     \item \code{select} for enabling the necessary other packages
       needed to build the current package (libraries, etc.)
     \end{itemize}
@@ -119,37 +120,48 @@ endmenu
 \begin{frame}[fragile]{\code{package/<pkg>/Config.in}: dependency example}
 
   \begin{columns}
-    \column{0.5\textwidth}
-    \begin{block}{radvd package}
+    \column{0.6\textwidth}
+    \begin{block}{btrfs-progs package}
       \tiny
 \begin{verbatim}
-config BR2_PACKAGE_RADVD
-        bool "radvd"
-        depends on BR2_USE_MMU # fork()
-        depends on BR2_INET_IPV6
-        select BR2_PACKAGE_FLEX
+config BR2_PACKAGE_BTRFS_PROGS
+        bool "btrfs-progs"
+        depends on BR2_USE_WCHAR # util-linux
+        depends on BR2_USE_MMU # util-linux
+        depends on BR2_TOOLCHAIN_HAS_THREADS
+        select BR2_PACKAGE_ACL
+        select BR2_PACKAGE_ATTR
+        select BR2_PACKAGE_E2FSPROGS
+        select BR2_PACKAGE_LZO
+        select BR2_PACKAGE_UTIL_LINUX
+        select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+        select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+        select BR2_PACKAGE_ZLIB
         help
-          IPv6 Router Advertisement Daemon.
+          Btrfs filesystem utilities
 
-          http://www.litech.org/radvd/
+          https://btrfs.wiki.kernel.org/in...
 
-comment "radvd needs a toolchain w/ IPv6"
+comment "btrfs-progs needs a toolchain w/ wchar, threads"
         depends on BR2_USE_MMU
-        depends on !BR2_INET_IPV6
+        depends on !BR2_USE_WCHAR || \
+               !BR2_TOOLCHAIN_HAS_THREADS
 \end{verbatim}
   \end{block}
-    \column{0.5\textwidth}
-    \small
+    \column{0.4\textwidth}
+    {\scriptsize
     \begin{itemize}
     \item \code{depends on BR2_USE_MMU}, because the package uses
       \code{fork()}. Note that there is no comment displayed about this
       dependency, because it's a limitation of the architecture.
-    \item \code{depends on BR2_INET_IPV6}, because the package requires
-      IPv6 support from the toolchain. There is an associated comment,
-      because IPv6 support can be added to the toolchain.
-    \item \code{select BR2_PACKAGE_FLEX}, because the package needs
-      \code{flex} to be available on the target.
-    \end{itemize}
+    \item \code{depends on BR2_USE_WCHAR} and \code{depends on
+        BR2_TOOLCHAIN_HAS_THREADS}, because the package requires
+      wide-char and thread support from the toolchain. There is an
+      associated comment, because such support can be added to the
+      toolchain.
+    \item Multiple \code{select BR2_PACKAGE_*}, because the package
+      needs numerous libraries.
+    \end{itemize}}
   \end{columns}
 \end{frame}
 
@@ -727,7 +739,7 @@ define EEPROG_BUILD_CMDS
 endef
 
 define EEPROG_INSTALL_TARGET_CMDS
-        $(INSTALL) -D $(@D)/eeprog $(TARGET_DIR)/usr/bin/eeprog
+        $(INSTALL) -m 0755 -D $(@D)/eeprog $(TARGET_DIR)/usr/bin/eeprog
 endef
 
 $(eval $(generic-package))
@@ -807,12 +819,13 @@ $(eval $(generic-package))
       and \code{<pkg>_INSTALL_TARGET_OPTS} to adjust the {\em make}
       target and options used for the installation.
     \item \code{<pkg>_AUTORECONF}. Defaults to \code{NO}, can be set
-      to \code{YES} is regenerating \code{Makefile.in} files and
+      to \code{YES} if regenerating \code{Makefile.in} files and
       \code{configure} script is needed. The infrastructure will
       automatically make sure {\em autoconf}, {\em automake}, {\em
         libtool} are built.
     \item \code{<pkg>_GETTEXTIZE}. Defaults to \code{NO}, can be set
-      to \code{YES} to {\em gettextize} the package.
+      to \code{YES} to {\em gettextize} the package. Only makes sense
+      if \code{<pkg>_AUTORECONF = YES}.
     \end{itemize}
   \end{itemize}
 \end{frame}
@@ -1019,7 +1032,7 @@ $(eval $(python-package))
     \begin{itemize}
     \item \code{FBSET_DEPENDENCIES = host-bison host-flex}
     \end{itemize}
-  \item No \code{Config.in}, not visible in \code{menuconfig}.
+  \item No \code{Config.in.host}, not visible in \code{menuconfig}.
   \end{itemize}
   \begin{block}{package/bison/bison.mk}
     \begin{minted}[fontsize=\tiny]{make}
diff --git a/slides/buildroot-rootfs/buildroot-rootfs.tex b/slides/buildroot-rootfs/buildroot-rootfs.tex
index 6d136f5..1610381 100644
--- a/slides/buildroot-rootfs/buildroot-rootfs.tex
+++ b/slides/buildroot-rootfs/buildroot-rootfs.tex
@@ -122,8 +122,9 @@ board/myproject/rootfs-overlay/etc/init.d/S99myapp
 TARGET_DIR=$1
 BOARD_DIR=board/myproject/
 
-# Adjust password of the 'default' user
-sed -i 's%^default::%default:jfbeg/OwGfiab:%' $TARGET_DIR/etc/shadow
+# Generate a file identifying the build (git commit and build date)
+echo $(git describe) $(date +%Y-%M-%d-%H:%m:%S) > \
+    $TARGET_DIR/etc/build-id
 
 # Create /applog mountpoint, and adjust /etc/fstab
 mkdir -p $TARGET_DIR/applog
diff --git a/slides/buildroot-tree/buildroot-tree.tex b/slides/buildroot-tree/buildroot-tree.tex
index 17aa8d7..c2a66ed 100644
--- a/slides/buildroot-tree/buildroot-tree.tex
+++ b/slides/buildroot-tree/buildroot-tree.tex
@@ -53,7 +53,7 @@
   \begin{itemize}
   \item \code{package/}
     \begin{itemize}
-    \item all the userspace packages (1500+)
+    \item all the userspace packages (1600+)
     \item \code{busybox/}, \code{gcc/}, \code{qt5/}, etc.
     \item \code{pkg-generic.mk}, core package infrastructure
     \item \code{pkg-cmake.mk}, \code{pkg-autotools.mk},



More information about the training-materials-updates mailing list