 Hello, I'm Michael D'Naca from Bootlin. Today, I'm going to share with you some nice, but not well-known tools that I discovered in BitRoot, and which you could find interesting to use in your embedded Linux projects. But before a few words about myself, I'm the founder and an embedded Linux engineer at Bootlin. We do development, training, and consulting on embedded Linux. And we focus only on free and open source software. I'm also a free software contributor. I'm the current maintainer of the Elixir cross-referencer that makes it easy to study the sources of big projects, such as the Linux kernel. It's quite well known. I'm also the current documentation maintainer for the Yocto project. And I'm the co-author of Bootlin's freely available embedded Linux and kernel training materials that you can find here with plenty of information for you to access. And I'm the former maintainer of GNU typist a long time ago. So back to this topic, I proposed this talk because I wanted to explore all the packages available in BitRoot. And according to my estimates, there are more than 2,800 packages. So I made up a summary here and counted. So you have interpreter languages and scripting, more than 600. This category is a bit deceiving because there are countless Python modules in there and components for other languages. But otherwise you have like many libraries, many networking applications, and those are for real ones. And then you can see it's a real treasure trove, many applications of all types. So let's discover them. First, a few details about how I approached this research. My first idea was to go through all the packages found in make menu config. But in addition to taking in a lot of time, it also made me overlook many interesting packages afterwards. So instead, I decided to check the more recent new packages in Git Commits, only going two years back in time. So you've got the more recent ones. Wanting, of course, the selection of components I made is completely arbitrary. It depends on the topics I'm familiar with. And I could be missing other cool nuggets in other topics. So I listed also the components I found in random order so that you don't get bored by very long categories you're not interested in. Here, of course, only free and open source software was selected. Bero doesn't support proprietary software anyway, except for a few firmware files. If you want to know the license of each package, you can find it easily in package slash package name slash package name not MK. In the abstract, I must also say that I promised to include demos, but I then realized that given the number of packages that would take too much time in preparation time and in presentation time, so I prefer to increase the list to make it longer. So I'm going to show my own selection of cool packages in my opinion. However, during the presentation, even if you're watching it afterwards, please let us know about useful tools that you could think about and that you discovered and that would deserve to be better known. So you can do this by contributing to this collaborative etherpad with this address here and we'll be able to check the suggestions from the audience on the pad at the end of the talk. Now, the first one I am listing here is TO, a simple TTY terminal application that was added into BitRoot in 2019. I actually discovered it a few months ago thanks to a customer who showed it to me and it's even simpler than PicoCom and a very nice thing about it is that it doesn't die when your device is disconnected. For example, after you suspended your laptop or if you just removed the cable temporarily. So it just waits and resumes nicely. There's also an easy to use command line, so you don't have to pass the parity, the bot rate, just TO and serial device name and you're good to go. There's a nice timestamping option that's embedded too. So that's worth giving a try. The next tool I discovered is called Beep App Tools. It's a tool for flashing block devices efficiently and reliably implemented by Artem Bitutski, which is a well-known developer in the community. It was added recently to BitRoot. It was originally created for the Tizen IVI project and what it can do is it can be much faster than DD and CP for flashing firmware images, taking advantage of unmapped areas in partitions or between partitions. They are called holes. It can also directly flash an image from a remote server without having to download it. It also implements integrity checking. Corruption will be noticed immediately. So that sounds very nice for flashing devices. The next one is a CA-Sync that presented as a tool to distribute file system images. It was added early this year. It was created by Lennart Puttering, a well-known developer again, the developer of SystemD, Pulse Audio, etc. It targets the delivery of OS images. It could be used for backup purposes too. And it combines the idea of the R-Sync algorithm with the idea of Gitsite Content Addressable File System. So it divides the files in chunks. The main goal is to minimize network traffic and disk space on both clients and servers. So it sounds like a nice alternative to R-Sync for many purposes. The next one is MuPDF, a lightweight PDF, XPS, and ebook viewer for EPUB format. It was added last year and it is very fast and produces very high quality output. It should be suitable for portable viewers because it's very small too. And however, I found some issues with some EPUB documents though. But the PDF output was just great like in this case. The next one is Knoopok, a new binary file editor that was added earlier this year. So it seems to be a quite exhaustive editor for binary data. Of course, you can edit bytes and bits, but it also comes with an entire language for describing the contents of your binaries, such as structures and possible areas. So actually the project comes with many so-called pickles to process many types of binary formats and of course debug understand the contents of your binaries and of course modify them. The next one is JNET, an easy to embed functional and imperative programming language that was added earlier this year. It's supposed to make a good system programming language or a language to embed in other programs in the same way as Lua and Gile. It has more built-in functionality and a richer core language than Lua, but is smaller than Gile and Python. And it's very easy to embed. You just need to use jnet.c and jnet.h, compile them and link them with your application. The next one is Ply that's described as a dynamic tracer for Linux. It's very simple to deploy. You don't need kernel modules, no compiler, unlike what you need for a system tab. You just need a libc and a modern kernel with ppf support. It has very low overhead and this way it can be used even for the hottest code paths. There's a CLAX syntax described what to trace and output and scripts can be written and modified in seconds. So that's very nice for debugging and it's much lighter and easier to deploy than system tab. Now the next one is a completely different one. It's called NeoFetch. It's a bash script to display system information. That includes hardware in a visually pleasing way as you can see here for Ubuntu. It's meant to be used actually in screenshots of your system. You can also add its output to your system logs if you want. And back in 2019 it was already supporting 150 different operating systems. The next one is called CoreMark. It's a microcontroller and CPU benchmarking tool. It allows to compare microprocessors and microcontrollers in terms of read, write, integer, control operations and pipeline performance. And it's actually small enough to fit in the CPU cache. So it may be useful for you if you hesitate between several CPUs for your design. Here you can see a comparison between Raspberry Pi 3 and Raspberry Pi 4. Next one is QuickJS. It's a small and embeddable JavaScript engine from Fabrice Berlard, the well-known developer of QMU, FFMPEG, TCC and so many others. So it's a small and easily embeddable program. You just need a few C files. There's no external dependency. And at the end it results into 210 kilobytes of x86 code for a simple Hello World program. What I'm showing here is numcal.com. It's a program using QuickJS. It's an online scientific calculator with advanced features. You can manipulate metrics, do algebra and all these things. So that's a nice example and it's online. And by the way, another cool project by Fabrice Berlard that I discovered on bellard.org is not in Beirut yet. And I can't really tell you its name. It's a bit vague. This is a technique that allows to compress English text or natural language text by using the probability of the next word computed by the GPT2 language model released by OpenAI. This actually achieves better compression than the best general purpose compressors. So why not? It only works on x86 CPUs with AVX2 support though because it has to manipulate huge vectors if I understand correctly. The next one I discovered is IP calc. It's a modern tool to assist in a network address calculations for IPv4 and IPv6. So it's actually a fork of the original IP calc from Fedora with the same name. But it has now since then replaced it. It's actually very easy to use from script because it generates variable descriptions as you can see on the right. And it also supports JSON output for further processing. The next one is called Cookinia from our colleagues at Sava Fair Linux. It's a shell script to run simple system level validation tests on embedded Linux firmware. So it's actually just easy to use BNSH script depending only on busybox and can output results in JUnit XML for use in Jenkins and other CI tools. And also it supports CSV. So it's very easy to deploy. You can write your own tests with lots of predefined routines. The next cool one is HTTP dates. It synchronizes the system type with web servers as a reference time source. It implements the HTTP time protocol, which is called HTTP. And it's useful when NTP UDP ports are blocked on your network. This relies on timestamps in HTTP headers actually. The accuracy of course is not as good as NTP. It's in the 0.5 second range, but it can improve when multiple servers are used. So that's a possible alternative when you can't use NTP. The next one is called MG. It's a microemax clone suitable for very small embedded systems. It's actually fitting in 130 kilobytes and it can be built only with the C library without encurses unlike other ones. So it strives to be as compatible as possible with GNU Emacs so it can easily switch between the two. The next one is called Bitwise. It's a multi-base interactive calculator targeting low-level hackers, kernel developers, and device driver developers. So it allows to manipulate data in multiple forms. There's a command line interface for quick operations. And then you have an interactive mode to toggle bits, applied bitwise operations such as and XOR, etc. And on shifts as well. So that seems great for manipulating your data for use in your code. Another recent one is called RTTY. It allows to access your device's terminal from anywhere through the web. So you can access your device through HTTP with SSL and TLS. It makes it easy to upload files and download files. Actually, there are other similar alternatives in BitRoot, such as TTYD added last year and sharing the box that's actually older. This sounds nice as an idea, but I would instead use a VPN if possible. This way, your device doesn't need a public IP address and doesn't have a public interface that could open the gate to attacks. Well, we are reaching the end of the list now. The last one I want to mention is Earlyoom. It's an out-of-memory killer and user space. So this one acts earlier than a kernel space out-of-memory killer that kicks in really at the last minute when the system is already on its knees. So this one runs periodically and watches available memory. And then if it's lower than 10% or something like that, I guess it's doable, it kills the same process as out-of-memory killer would. That's the one with the highest OOM score in PROC PID OOM score. Right? So that sounds like an alternative to out-of-memory killer if you want to keep the interactivity of the system, the responsiveness of the system. To finish, I'm going to show you the result of my research when I used menu config to find interesting packages. So as you will see here, the packages that I show have been introduced in build route for the first time a longer time ago, of course. So there's Motion, which is a motion detector software for video cameras. So basically it watches the output of the camera and detect motion. And then you can trigger the execution of scripts to record or to react or things like that. PV is a pipe viewer that allows to add progress information to your command line pipes. That's nice when you're dealing with big pipes, it can make a difference. SSH is something that we use very frequently at Bootlin. It's very convenient to share files with a server or an edit system through SSH. So we use it to access build outputs on our big servers here at Bootlin, the big compute servers that we have that are much faster than our laptops, of course. WebP is an image format that is a superior alternative to PNG and JPEG that's supported by all browsers now and that can be lossy or lossless and that yields better compression than those formats. Last but not least, ZLog is a reliable, high-performance, thread safe, flexible, pure C logging library that you can include in your C programs for logging. I have more. So the first one is Eigen. It's a C++ vector computation library. There's no compiling necessary to just include its headers in your program and you're good to go. The next one is Chrony, an alternative to NTPD which also supports NTP. But can also use time from GPS frames if you have a GPS device on your system. There's also Line Noise which is a BSD alternative to GNU ReadLine which is a GPL. So this has constraints. As MSMTP is a convenient and lightweight SMTP client to relay mail to an external SMTP server. So you can write it on your device and send mail through public SMTP servers. Be careful with it. It's a GPL V3. And then the last one is Mosh. It's a SSH client that resists disconnects. So it's great to stay connected to a server when you have an intermittent internet connection, when you have to disconnect, when you have to suspend your laptop, or actually to a device. So in particular, I'm using it to stay connected to my IRC server that runs my IRC client. So that's nice. I'm reaching the end of the list now. So the last ones are NGREP. It's a network grep. A lightweight alternative to TCPDOM that allows to look for content in some network traffic. NLoad is a console application monitoring network traffic and bandwidth usage in real time. It hasn't been maintained for four years, but it still works. And it outputs stuff in your terminal. Tiny or teeny, that's a reverse of init, actually. It's a simple init process to avoid zombies. So it's meant to be used in containers, but could also be used when you start your application directly as the init process, no init program. In that case, use init equal slash teeny dash dash slash app in the kernel command line. So everything that's after dash dash in the kernel command line is actually passed to the init process as an argument. That's how it works. The last one, very last one, very last one is XXH. It's a very fast hashing algorithm that claims to run at RAM speed limits. Hey, that's the end of this part. And now the second part comes. So here I would like you to continue to contribute to the public pad and chat together about existing tools, the ones that are less unknown but deserve better publicity. So let's get started. The second part of this talk about chatting on the public channels of the conference and also directly on the pad. So even if you're attending this presentation weeks after the conference or months after the conference, you can still contribute to the public pad. So let's get started and thank you for your attention and enjoy the rest of the conference. Thanks again.