\documentclass[aspectratio=169,obeyspaces,spaces,hyphens,dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}% http://ctan.org/pkg/lm
\usepackage{minted}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage[normalem]{ulem}

\mode<presentation>
\usetheme{Bootlin}

\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
  \hbox{}\nobreak\hfil(#1)
  \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}

\newsavebox\mybox
\newenvironment{aquote}[1]
  {\savebox\mybox{#1}\begin{quotation}}
  {\signed{\usebox\mybox}\end{quotation}}

\title{Embedded Linux nuggets found in Buildroot package Eldorado}
\authors{Michael Opdenacker}
\email{michael.opdenacker@bootlin.com}
\slidesurl{https://bootlin.com/pub/conferences/2021/elc}
\institute{Bootlin}
\conference{Embedded Linux Conference 2021}

\begin{document}

\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\section{Embedded Linux nuggets found in Buildroot package Eldorado}
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}

\begin{frame}{Michael Opdenacker}
\begin{columns}
  \column{0.7\textwidth}
  \begin{itemize}
  \item Founder and Embedded Linux engineer at Bootlin:
    \begin{itemize}
    \item Embedded Linux {\bf expertise}
    \item {\bf Development}, consulting and training
    \item Focusing {\bf only on Free and Open Source Software}
    \end{itemize}
  \item Free Software contributor:
    \begin{itemize}
      \item Current maintainer of the Elixir Cross Referencer, making it
            easier to study the sources of big C projects like the Linux kernel.
            See \url{https://elixir.bootlin.com}
      \item Current documentation maintainer for the Yocto Project
      \item Co-author of Bootlin's freely available embedded Linux and
	    kernel training materials (\url{https://bootlin.com/docs/})
      \item Former maintainer of \href{https://www.gnu.org/software/gtypist/}{GNU Typist}
    \end{itemize}
  \end{itemize}
  \column{0.3\textwidth}
    \begin{center}
    \vspace{0.5cm}
    \includegraphics[width=0.5\textwidth]{graphics/logo-cc.pdf}\\
    \vspace{0.5cm}
    \includegraphics[width=\textwidth]{graphics/elixir.pdf}
    \end{center}
\end{columns}
\end{frame}

\begin{frame}{Buildroot package Eldorado}
\small
Buildroot 2021.08 supports about 2850 packages,\\
estimated by the number of \code{.mk} files.
\tiny
\begin{center}
        \begin{tabular}{| l | r |}
        \hline
        Section & Toplevel menu entries \\
        \hline
        Audio and video applications & 52 \\
        \hline
        Compressors and decompressors & 14 \\
        \hline
        Debugging, profiling and benchmark & 68 \\
        \hline
        Development tools & 37 \\
        \hline
        Filesystem and flash utilities & 42 \\
        \hline
        Fonts, cursors, icons, sounds and themes & 17 \\
        \hline
        Games & 22 \\
        \hline
        Graphic libraries and applications (graphic/text) & 93 \\
        \hline
        Hardware handling & 185 \\
        \hline
        Interpreter languages and scripting & 652 \\
        \hline
        Libraries (all types) & 677 \\
        \hline
        Mail & 8 \\
        \hline
        Miscellaneous & 27 \\
        \hline
        Networking applications & 268 \\
        \hline
        Package managers & 3 \\
        \hline
        Real-time & 2 \\
        \hline
        Security & 15 \\
        \hline
        Shell and utilities & 37 \\
        \hline
        System tools & 96 \\
        \hline
        Text editors and viewers & 9 \\
        \hline
        \end{tabular}
\end{center}
\end{frame}

\begin{frame}{Comments}
  Approach
  \begin{itemize}
    \item Tried going through all the packages in \code{make menuconfig},\\
          but it made me overlook many interesting packages.
    \item Instead, checked the more recent new packages in git commits
          (going only 2 years back in time)
    \item Warning: the selection of components is completely arbitrary.
          It also depends on the topics I'm familiar with, and I could
	  be missing other cool nuggets.
    \item I listed the components I found in random order, so that you
          don't get bored by categories you're not interested in.
  \end{itemize}
  Tips
  \begin{itemize}
    \item Only Free and Open Source software was selected in this presentation.
    \item For each package, the license is easy to find in
	  \code{package/<package>/<package>.mk}
  \end{itemize}
\end{frame}

\begin{frame}{Contribute to the public pad}
  I'm going to show my own selection of "cool" packages in my opinion
  \begin{itemize}
  \item During the presentation (even if you are watching it afterwards),
        let us know about useful tools that you discovered and would
        deserve to be better known.
  \item Do this by contributing to this Etherpad:\\
        \url{https://annuel2.framapad.org/p/buildroot-nuggets-9pmi?lang=en}
  \item We'll be able to check the suggestions on the pad at the
	end of the talk.
  \end{itemize}
\end{frame}

\begin{frame}{tio}
  A simple TTY terminal I/O application\\
  \url{https://tio.github.io/}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
    \item Added on 2019-12-22
    \item Even simpler than Picocom
    \item Doesn't die when your device is disconnected. Just waits and
	  resumes nicely.
    \item Easy command line (no line settings):\\
          \code{tio /dev/ttyUSB0}
    \item Nice timestamping option
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/tio.png}\\
  \scriptsize \url{https://tio.github.io/images/tio-demo.gif}
  \end{columns}
\end{frame}

\begin{frame}{bmap-tools}
  Tool for flashing block devices efficiently and reliably \\
  From Artem Bityutskiy \\
  \url{https://github.com/intel/bmap-tools}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2021-06-21
     \item Originally created for the {\em Tizen IVI} project.
     \item Can be much faster than \code{dd} and \code{cp}, taking advantage
           of unmapped areas ({\em holes}).
     \item Can directly flash an image from a remote server without
           downloading it first.
     \item Implements integrity checking. Corruption will be noticed
           immediately.
  \end{itemize}
  \column{0.4\textwidth}
  \small
  \begin{block}{}
Tool to flash image files to block devices using the block map.
bmaptool is a generic tool for creating the block map (bmap)
for a file, and copying files using the block map. The idea is
that large file containing unused blocks, like raw system
image files, can be copied or flashed a lot faster with
bmaptool than with traditional tools like "dd" or "cp".
  \end{block}
  \end{columns}
\end{frame}

\begin{frame}{casync}
  casync — A tool for distributing file system images\\
  \url{https://github.com/systemd/casync}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2021-01-10
     \item By Lennart Poettering (Systemd, PulseAudio...)
     \item Targeting the delivery of OS images. Could be
	   used for backup purposes too.
     \item Combines the idea of the rsync algorithm with the
           idea of git-style content-addressable file systems.
     \item The main goals are to minimize network traffic
	   and disk space on both clients and servers.
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[width=\textwidth]{graphics/casync.png}
  \end{columns}
\end{frame}

\begin{frame}{MuPDF}
  Lightweight PDF, XPS, and E-book (EPUB) viewer\\
  \url{https://www.mupdf.com/}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2020-02-07
     \item Very fast and producing high quality output
     \item Should be suitable for portable viewers
     \item Some issues with some EPUB documents though
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[height=0.6\textheight]{graphics/mupdf.png}
  \end{columns}
\end{frame}

\begin{frame}{GNU Poke}
  A new binary file editor - \url{http://www.jemarch.net/poke}
  \begin{columns}
  \column{0.5\textwidth}
  \small
  \begin{block}{}
GNU poke is an interactive, extensible editor for binary data.  Not
limited to editing basic entities such as bits and bytes, it provides
a full-fledged procedural, interactive programming language designed
to describe data structures and to operate on them.
  \end{block}
  \begin{itemize}
    \item Added on 2021-05-17
    \item Time to ditch your hexadecimal editor!
    \item Ready made {\em pickles} are available to process
	  many types of binary formats.
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[height=0.6\textheight]{graphics/poke.png}
  \end{columns}
\end{frame}

\begin{frame}{Janet}
  Easy to embed functional and imperative programming language\\
  \url{https://janet-lang.org/}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2021-02-13
     \item Makes a good system scripting language, or a language to
           embed in other programs, like Lua and Guile. It has more built-in functionality
           and a richer core language than Lua, but is smaller than GNU Guile or Python.
     \item Easy to embedded: just need \code{janet.c} and \code{janet.h}
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[width=\textwidth]{graphics/janet.png}
  \end{columns}
\end{frame}

\begin{frame}{Ply}
  A dynamic tracer for Linux\\
  \url{https://wkz.github.io/ply/}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
     \item Added on 2021-01-06
     \item Very simple to deploy: no need for kernel modules,
           no compiler, just need a libc and a kernel with BPF support.
     \item Very low overhead, can be used even for "the hottest code
           paths"
     \item C like syntax to describe what to trace and output.
           Scripts can be written and modified in seconds.
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/ply.png}
  \end{columns}
\end{frame}

\begin{frame}{Neofetch}
  Bash script to display system information\\
  \url{https://github.com/dylanaraps/neofetch}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
     \item Added on 2021-01-15
     \item This displays system information, including hardware, in a
	   visually pleasing way
     \item Meant to be used in screenshots of your system
     \item You can also add its output to your system logs
     \item 2019: already supporting 150 different operating systems
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/neofetch.png}
  \end{columns}
\end{frame}

\begin{frame}{CoreMark}
  Microcontroller and CPU benchmarking tool\\
  \url{https://www.eembc.org/coremark/}
  \begin{columns}
  \column{0.7\textwidth}
  \begin{itemize}
     \item Added on 2020-11-12
     \item Allows to compare CPUs and MCUs in terms
           read/write, integer, control operations and
           pipeline performance.
     \item Small enough to fit in the CPU cache
     \item May be useful if you hesitate between several
	   CPUs for your design.
  \end{itemize}
  \column{0.3\textwidth}
  \includegraphics[width=\textwidth]{graphics/coremark.png}
  \end{columns}
\end{frame}

\begin{frame}{QuickJS}
  Small and embeddable Javascript engine\\
  \url{https://bellard.org/quickjs/}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
     \item Added on 2020-11-06
     \item Yet another project from Fabrice Bellard (QEMU, FFMPEG, TCC...)
     \item Small and easily embeddable: just a few C files, no external dependency,
           210 KiB of x86 code for a simple hello world program.
     \item Used in Numcalc (\url{http://numcalc.com/}), an online
           scientific calculator with advanced features.
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/numcalc.png}
  \end{columns}
\end{frame}

\begin{frame}{Another cool project by Fabrice Bellard}
  Lossless compression of natural language text messages\\
  \url{https://bellard.org/textsynth/sms.html}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Not in Buildroot yet!
     \item Allows to compress English text by using the probability
           of the next word computed by the GPT-2 language model
           released by OpenAI.
     \item Achieves better compression than the best general purpose
	   compressors.
     \item Only works on x86 CPUs with AVX2 support.
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[width=\textwidth]{graphics/gpt2tc.png}
  \end{columns}
\end{frame}

\begin{frame}{ipcalc}
  Modern tool to assist in network address calculations \\
  for IPv4 and IPv6\\
  \url{https://gitlab.com/ipcalc/ipcalc}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
     \item Added on 2020-10-14
     \item A fork of \code{ipcalc} from Fedora, which has now since
           replaced it.
     \item Easy to use from scripts and also supports JSON output
	   for further processing.
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/ipcalc.png}
  \end{columns}
\end{frame}

\begin{frame}{cukinia}
  Shell script to run simple system-level \\
  validation tests on embedded Linux firmware \\
  \url{https://github.com/savoirfairelinux/cukinia}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
     \item Added on 2020-05-05
     \item Easy to use \code{/bin/sh} script depending only on BusyBox.
     \item Can output results in JUnit XML (for Jenkins and other CI
           tools) and CSV
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/cukinia.png}
  \end{columns}
\end{frame}

\begin{frame}{htpdate}
  Synchronize system time with web servers \\
  as a reference time source\\
  \url{https://github.com/angeloc/htpdate}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2020-08-07
     \item Implementing the HTTP Time Protocol (HTP)
     \item Useful when NTP UDP ports are blocked on your network
     \item Relies on timestamps in HTTP headers
     \item Accuracy in the 0.5 second range. Improves when
	   multiple servers are used.
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[width=\textwidth]{graphics/htpdate.png}
  \end{columns}
\end{frame}

\begin{frame}{mg}
  MicroEmacs clone suitable for very small embedded systems\\
  \url{https://github.com/troglobit/mg/}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2020-09-01
     \item MicroEmacs clone fitting in 130 KB
     \item Can be built only with the C library, without {\em ncurses}.
     \item As compatible as possible with GNU Emacs.
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[height=0.6\textheight]{graphics/mg.png}
  \end{columns}
\end{frame}

\begin{frame}{bitwise}
  Multi base interactive calculator\\
  \url{https://github.com/mellowcandle/bitwise}
  \begin{columns}
  \column{0.5\textwidth}
  \begin{itemize}
     \item Added on 2020-07-06
     \item Targeting low level hackers, kernel developers and device drivers developers
     \item Command line interface for quick operations
     \item Allows to toggle bits and apply bitwise operations and shifts
           in interactive mode.
  \end{itemize}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{graphics/bitwise.png}
  \end{columns}
\end{frame}

\begin{frame}{rtty}
  Access your device's terminal from anywhere via the web.\\
  \url{https://github.com/zhaojh329/rtty}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2020-03-10
     \item Allows to access your device through http (with SSL and TLS)
     \item Easy to upload files and download files
     \item Alternatives in Buildroot: {\em ttyd} (added 2020-06-16), {\em shellinabox} (older)
     \item My advice: use a VPN instead, this way your device doesn't
           need a public IP address and doesn't have a public interface.
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[width=\textwidth]{graphics/rtty.png}
  \end{columns}
\end{frame}

\begin{frame}{earlyoom}
  Out Of Memory killer in userspace\\
  \url{https://github.com/rfjakob/earlyoom}
  \begin{columns}
  \column{0.6\textwidth}
  \begin{itemize}
     \item Added on 2020-06-12
     \item Acting earlier than the kernelspace OOM killer,
           that kicks in when the system is already on its knees.
     \item Still killing the same process with the highest
	   \code{/proc/*/oom_score}
  \end{itemize}
  \column{0.4\textwidth}
  \includegraphics[width=\textwidth]{graphics/earlyoom.png}
  \end{columns}
\end{frame}

\begin{frame}{Older nuggets (1)}
  Actively maintained of course
  \begin{itemize}
  \item {\em Motion} (2016-09-27) \\
        \url{https://motion-project.github.io} \\
        Motion detector software for video cameras
  \item {\em pv} - Pipe viewer (2011-10-07) - \url{http://www.ivarch.com/programs/pv.shtml} \\
        Add progress information to your command line pipes.
  \item {\em sshfs} (2009-11-24) - \url{https://github.com/libfuse/sshfs} \\
        Very convenient to share files with a server or embedded system through ssh.
	Great to access build outputs on big servers.
  \item {\em webp} (2013-01-24) - \url{https://developers.google.com/speed/webp/} \\
        Superior alternative to PNG and JPEG, can be lossy and lossless
  \item {\em zlog} (2014-03-03) - \url{https://github.com/HardySimpson/zlog} \\
        Reliable, high-performance, thread safe, flexible, pure C logging library.
  \end{itemize}
\end{frame}

\begin{frame}{Older nuggets (2)}
  \begin{itemize}
  \item {\em Eigen} (2013-09-05) - \url{http://eigen.tuxfamily.org/} \\
        C++ vector computation library. \\
        No compiling necessary, just need to include the headers.
  \item {\em chrony} (2013-05-07) - \url{https://chrony.tuxfamily.org/} \\
        Alternative to ntpd, can also use time from GPS frames.
  \item {\em linenoise} (2012-12-05) - \url{https://github.com/antirez/linenoise} \\
        A BSD alternative to GNU readline.
  \item {\em msmtp} (2012-04-17) - \url{https://marlam.de/msmtp/} \\
        Convenient and lightweight SMTP client to relay mail to an external SMTP server. Caution: GPLv3
  \item {\em mosh} (2015-07-26) - \url{https://mosh.org}\\
        SSH client that resists disconnects.
  \end{itemize}
\end{frame}

\begin{frame}{Older nuggets (3)}
  \begin{itemize}
  \item {\em ngrep} (2011-09-10) - \url{https://github.com/jpr5/ngrep/} \\
        Network grep - Lightweight alternative to tcpdump
  \item {\em nload} (2016-03-08) - \url{http://www.roland-riegel.de/nload/} \\
        Console application monitoring network traffic and bandwidth usage in real time (not actively maintained for 4 years)
  \item {\em tini} (2018-08-10) (reverse of "init") - \url{https://github.com/krallin/tini} \\
        Simplest init process to avoid zombies. Meant to be used in
        containers but could be used when you start your application
	directly (no init program) - Use \code{init=/tini -- /app} in the kernel command line.
  \item {\em xxhash} (2015-07-16) - \url{https://github.com/Cyan4973/xxHash} \\
        Very fast hashing algorithm, running at RAM speed limits.
  \end{itemize}
\end{frame}

\questionslide
\end{document}
