SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
SCaLE 17x
Getting started with
Buildroot
Trevor Woerner
trevor@toganlabs.com
Copyright © 2019 Togán Labs
Creative Commons BY-SA 3.0 license.
Corrections, suggestions, contributions and translations are welcome!
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 1 of 40
Trevor Woerner
▶ Senior Software Developer at Togán Labs
▶ Embedded Linux Development and Consulting
▶ Specialize in OpenEmbedded/Yocto
▶ Strong open-source focus
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 2 of 40
Thomas Petazzoni
▶ Initially created this presentation
▶ CTO and Embedded Linux engineer at Bootlin
▶ major contributor to buildroot
▶ one of 3 people with commit access to buildroot
▶ Strong open-source focus
Formerly Free Electrons
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 3 of 40
Using an embedded Linux system
▶ the first thing you did at the very start of the labs
▶ has allowed you to do everything you’ve done with the board
▶ wrote one HUGE image to the SDcard – 3.4GB!!
▶ it took my laptop over 13 minutes
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 4 of 40
Using an embedded Linux system
▶ what does the SDcard look like post-flashing?
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 5 of 40
Using an embedded Linux system
▶ one big file was flashed, but the card now has partitions and lots of files
▶ works cross-platform (x86_64 host, ARM target)
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 6 of 40
Using an embedded Linux system
▶ it’s all there in the *.img file
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 7 of 40
Using an embedded Linux system
▶ it’s all there in the *.img file
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 8 of 40
Can I build an embedded Linux system?
▶ with my own contents
▶ bootloader
▶ kernel
▶ init
▶ apps (→ dependencies)
▶ to target multiple devices
▶ within a certain size (smaller)
▶ containing only what a production device needs
▶ with the latest fixes
▶ built up from nothing, not simply imaging a disk (horse/cart)
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 9 of 40
Can I build an embedded Linux system?
YES!
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 10 of 40
Can I build an embedded Linux system?
Caveats:
▶ cross-compiling/toolchain
▶ find/get the sources (bzr, cvs, git, hg, scp, svn, wget, ...) can’t hope for
pre-compiled
▶ checksum (md5, sha256, sha512, ...)
▶ dependencies
▶ unpack (gzip, bzip2, xz, zip, ...)
▶ patch
▶ configure
▶ build (make, cmake, ant, maven, waf, ninja, gyp, meson, ...)
▶ device-specific tweaks/tricks
▶ lots of choice, hard to get right
▶ one doesn’t slap together a cohesive, working set, by accident
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 11 of 40
Can I build an embedded Linux system?
problems:
▶ there is no ”one correct way” to write (open-source) software
▶ language
▶ repository system
▶ build system
▶ location
▶ licensing
▶ not enough developers consider cross-compilation
solution:
▶ use an embedded Linux build system
▶ PLEASE don’t ”roll your own”
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 12 of 40
Building an embedded Linux system
+ Readily available
- Large, usually 100+ MB (→ GB!)
- Not available for all architectures/devices
- Not easy to customize
- Generally require native compilation
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 13 of 40
Building an embedded Linux system
+ Smaller and flexible
- Very hard to handle cross-compilation and dependencies
- Not reproducible
- No benefit from other people’s work
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 14 of 40
Building an embedded Linux system
+ Small and flexible
+ Reproducible, handles cross-compilation and dependencies
+ Available for virtually all architectures
- One tool to learn
- Build time
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 15 of 40
Embedded Linux build system: principle
▶ Building from source → lot of flexibility
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 16 of 40
Embedded Linux build system: principle
▶ Building from source → lot of flexibility
▶ Cross-compilation → leveraging fast build machines
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 17 of 40
Embedded Linux build system: principle
▶ Building from source → lot of flexibility
▶ Cross-compilation → leveraging fast build machines
▶ Recipes for building components → easy
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 18 of 40
Recipes, meta-data
▶ all embedded Linux build systems have:
▶ a tool for building the image (i.e. make)
▶ the recipes or meta-data describing how to handle each component
▶ where it’s located (github, gitlab, bitbucket, ...)
▶ how to fetch it (wget, svn, git, ...)
▶ patches
▶ how to build (make, meson, cmake, ...)
▶ configuration
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 19 of 40
Buildroot at a glance
▶ Is an embedded Linux build system, builds from source:
▶ cross-compilation toolchain
▶ root filesystem with many libraries/applications, cross-built
▶ kernel and bootloader images
▶ Fast, simple root filesystem in minutes
▶ Easy to use and understand: kconfig and make
▶ Small root filesystem, default 2 MB
▶ Roughly 2170 packages available
▶ Generates filesystem images, not a distribution
▶ Vendor neutral
▶ Active community, stable releases every 3 months
▶ Started in 2001, oldest still maintained build system
▶ http://buildroot.org
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 20 of 40
Getting started
$ git clone git://git.busybox.net/buildroot
$ cd buildroot
$ make menuconfig
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 21 of 40
Buildroot configuration
1. Target architecture
▶ Architecture
ARC, ARM, Aarch64, csky, m68k, Microblaze,
MIPS(64), NIOS II, OpenRISC, PowerPC(64),
RISC-V, SuperH, SPARC(64), x86, x86_64, Xtensa
▶ Specific processor (variant) / Floating-point
strategy
▶ ABI
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 22 of 40
Buildroot configuration
1. Target architecture
2. Build options
▶ Download directory
▶ Number of parallel jobs
▶ Use of ccache
▶ Shared or static libraries
▶ etc.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 23 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
▶ Buildroot toolchain
▶ Buildroot builds the toolchain
▶ uClibc-ng, glibc, musl
▶ External toolchain
▶ Uses a pre-built toolchain
▶ Profiles for existing popular toolchains
Linaro, Sourcery CodeBench, etc.
▶ Custom toolchains
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 24 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
▶ Init system to use: Busybox, Sysvinit, Systemd
▶ /dev management solution: static, devtmpfs,
mdev, udev
▶ Hostname, password, getty terminal, etc.
▶ Root filesystem overlay
▶ Custom post build and post image scripts
▶ etc.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 25 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
▶ Kernel source (stable version, Git tree, patches)
▶ Kernel configuration
▶ Support for kernel extensions: RTAI, Xenomai,
aufs, etc.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 26 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
▶ Roughly 2170 packages
▶ Qt5, X.org, Gtk, EFL
▶ GStreamer, ffmpeg
▶ Python, Perl, Ruby, Lua, Erlang
▶ Samba, OpenSSL, OpenSSH, dropbear,
lighttpd
▶ OpenGL support for various platforms
▶ And many, many more libraries and utilities
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 27 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
7. Filesystem images
▶ Major filesystem formats supported
▶ axfs
▶ btrfs
▶ cloop
▶ cpio, for kernel initramfs
▶ cramfs
▶ ext2/3/4
▶ f2fs
▶ jffs2
▶ romfs
▶ squashfs
▶ tar
▶ ubifs
▶ yaffs2
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 28 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
7. Filesystem images
8. Bootloaders
▶ Barebox
▶ Gummiboot
▶ Grub2
▶ shim
▶ Syslinux
▶ U-Boot
▶ and more platform-specific bootloaders:
imx-bootlets, at91bootstrap, etc.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 29 of 40
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
7. Filesystem images
8. Bootloaders
9. Host utilities
▶ Allows to build some native tools, useful for
development.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 30 of 40
Building and using
▶ To start the build: make
▶ Results in output/images:
▶ rootfs.ext4, root filesystem in ext4 format
▶ zImage, Linux kernel image
▶ am335x-pocketbeagle.dtb, Linux kernel Device Tree blob
▶ u-boot.img, U-Boot bootloader image
▶ MLO, U-Boot bootloader image
▶ Ready to be flashed on your embedded system.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 31 of 40
Exploring the build output
▶ All the output produced by Buildroot is stored in output/
▶ Can be customized using O= for out-of-tree build
▶ output/ contains
▶ output/build, with one sub-directory for the source code of each component
▶ output/host, which contains all native utilities needed for the build, including the
cross-compiler
▶ output/host/<tuple>/sysroot, which contains all the headers and libraries built
for the target
▶ output/target, which contains almost the target root filesystem
▶ output/images, the final images
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 32 of 40
Summarized build process
1. Check core dependencies
2. For each selected package, after taking care of its dependencies: download,
extract, patch, configure, build, install
▶ To target/ for target apps and libs
▶ To host/<tuple>/sysroot for target libs
▶ To host/ for native apps and libs
▶ Filesystem skeleton and toolchain are handled as regular packages
3. Copy rootfs overlay
4. Call post build scripts
5. Generate the root filesystem image
6. Call post image scripts
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 33 of 40
Customizing the build
Besides the existing packages and options, there are multiple ways to customize the
generated root filesystem:
▶ Create custom post-build and/or post-image scripts
▶ Use a root filesystem overlay, recommended to add all your config files
▶ Add your own packages
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 34 of 40
Adding a new package: Config.in
package/libmicrohttpd/Config.in
config BR2_PACKAGE_LIBMICROHTTPD
bool "libmicrohttpd"
depends on BR2_TOOLCHAIN_HAS_THREADS
help
GNU libmicrohttpd is a small C library that makes it easy to
run an HTTP server as part of another application.
http://www.gnu.org/software/libmicrohttpd/
comment "libmicrohttpd needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
package/Config.in
[...]
source "package/libmicrohttpd/Config.in"
[...]
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 35 of 40
Adding a new package: <pkg>.mk, <pkg>.hash
package/libmicrohttpd/libmicrohttpd.mk
LIBMICROHTTPD_VERSION = 0.9.59
LIBMICROHTTPD_SITE = $(BR2_GNU_MIRROR)/libmicrohttpd
LIBMICROHTTPD_LICENSE = LGPL-2.1+
LIBMICROHTTPD_LICENSE_FILES = COPYING
LIBMICROHTTPD_INSTALL_STAGING = YES
LIBMICROHTTPD_CONF_OPT = --disable-curl --disable-examples
$(eval $(autotools-package))
package/libmicrohttpd/libmicrohttpd.hash
# Locally calculated
sha256 9b9ccd7d0b11b0e17... libmicrohttpd-0.9.59.tar.gz
sha256 70e12e2a60151b9ed... COPYING
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 36 of 40
Adding a new package: infrastructures
▶ In order to factorize similar behavior between packages using the same build
mechanism, Buildroot has package infrastructures
▶ autotools-package for autoconf/automake based packages
▶ cmake-package for CMake based packages
▶ python-package for Python Distutils and Setuptools based packages
▶ generic-package for non-standard build systems
▶ And more: luarocks-package, perl-package, rebar-package,
kconfig-package, etc.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 37 of 40
Defconfigs
▶ Pre-defined configurations for popular platforms
▶ They build a minimal system for the platform
▶ make <foobar>_defconfig to load one of them
▶ Some of the configs
▶ RasberryPi
▶ BeagleBone
▶ CubieBoard
▶ PandaBoard
▶ Many Atmel development boards
▶ Several Freescale i.MX6 boards
▶ Many Qemu configurations
▶ and more...
▶ make list-defconfigs for the full list
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 38 of 40
Buildroot design principles
▶ Cross-compilation only: no support for doing development on the target.
▶ No package management system: Buildroot doesn’t generate a distribution,
but a firmware
▶ Don’t be smart: if you do a change in the configuration and restarts the build,
Buildroot doesn’t try to be smart. Only a full rebuild will guarantee the correct
result.
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 39 of 40
Documentation and support
▶ Extensive manual: https://buildroot.org/downloads/manual/manual.html
▶ 3-day training course, with freely available materials:
https://bootlin.com/training/buildroot/
▶ Mailing list: http://lists.busybox.net/pipermail/buildroot/
▶ IRC channel: #buildroot on Freenode
- Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 40 of 40

Contenu connexe

Tendances

LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLinaro
 
Yocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeYocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeMarcelo Sanz
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMSherif Mousa
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingScyllaDB
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionSherif Mousa
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded trainingH Ming
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Anne Nicolas
 
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...linuxlab_conf
 
Stefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto ProjectStefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto Projectlinuxlab_conf
 

Tendances (20)

Linux Systems: Getting started with setting up an Embedded platform
Linux Systems: Getting started with setting up an Embedded platformLinux Systems: Getting started with setting up an Embedded platform
Linux Systems: Getting started with setting up an Embedded platform
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
Yocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeYocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration Initiative
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARM
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded training
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Stefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto ProjectStefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto Project
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 

Similaire à Getting Started with Buildroot

Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneAnne Nicolas
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems Mender.io
 
FOSDEM_2019_Buildroot_RISCV.pdf
FOSDEM_2019_Buildroot_RISCV.pdfFOSDEM_2019_Buildroot_RISCV.pdf
FOSDEM_2019_Buildroot_RISCV.pdfssuser30e7d2
 
Xgboost readthedocs-io-en-release 1.3.3
Xgboost readthedocs-io-en-release 1.3.3Xgboost readthedocs-io-en-release 1.3.3
Xgboost readthedocs-io-en-release 1.3.3Angie Ihirwe
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devicesMender.io
 
Open Source Firmware - oSC19
Open Source Firmware - oSC19Open Source Firmware - oSC19
Open Source Firmware - oSC19Daniel Maslowski
 
Kernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using BuildrootKernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using BuildrootAnne Nicolas
 
Introduction to EasyBuild: Tutorial Part 1
Introduction to EasyBuild: Tutorial Part 1Introduction to EasyBuild: Tutorial Part 1
Introduction to EasyBuild: Tutorial Part 1inside-BigData.com
 
Hands on with embedded linux using zero hardware
Hands on with embedded linux using zero hardwareHands on with embedded linux using zero hardware
Hands on with embedded linux using zero hardwareRajesh Sola
 
Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018Mender.io
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Embedded Linux Odp
Embedded Linux OdpEmbedded Linux Odp
Embedded Linux Odpghessler
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...Yoshitake Kobayashi
 
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...melbats
 
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner example
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner exampleKernel Recipes 2014 - Supporting a new ARM platform: the Allwinner example
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner exampleAnne Nicolas
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesMender.io
 
unixtoolbox.pdf
unixtoolbox.pdfunixtoolbox.pdf
unixtoolbox.pdfqqlove2
 

Similaire à Getting Started with Buildroot (20)

Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyone
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems
 
FOSDEM_2019_Buildroot_RISCV.pdf
FOSDEM_2019_Buildroot_RISCV.pdfFOSDEM_2019_Buildroot_RISCV.pdf
FOSDEM_2019_Buildroot_RISCV.pdf
 
Xgboost readthedocs-io-en-release 1.3.3
Xgboost readthedocs-io-en-release 1.3.3Xgboost readthedocs-io-en-release 1.3.3
Xgboost readthedocs-io-en-release 1.3.3
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
 
Open Source Firmware - oSC19
Open Source Firmware - oSC19Open Source Firmware - oSC19
Open Source Firmware - oSC19
 
Kernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using BuildrootKernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using Buildroot
 
Introduction to EasyBuild: Tutorial Part 1
Introduction to EasyBuild: Tutorial Part 1Introduction to EasyBuild: Tutorial Part 1
Introduction to EasyBuild: Tutorial Part 1
 
Hands on with embedded linux using zero hardware
Hands on with embedded linux using zero hardwareHands on with embedded linux using zero hardware
Hands on with embedded linux using zero hardware
 
Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Embedded Linux Odp
Embedded Linux OdpEmbedded Linux Odp
Embedded Linux Odp
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
 
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
 
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner example
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner exampleKernel Recipes 2014 - Supporting a new ARM platform: the Allwinner example
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner example
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
 
Unixtoolbox
UnixtoolboxUnixtoolbox
Unixtoolbox
 
unixtoolbox.pdf
unixtoolbox.pdfunixtoolbox.pdf
unixtoolbox.pdf
 
unixtoolbox.pdf
unixtoolbox.pdfunixtoolbox.pdf
unixtoolbox.pdf
 

Plus de Trevor Woerner

Sensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiSensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiTrevor Woerner
 
Yocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onYocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onTrevor Woerner
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnTrevor Woerner
 
Getting Started with Buildroot - Lab
Getting Started with Buildroot - LabGetting Started with Buildroot - Lab
Getting Started with Buildroot - LabTrevor Woerner
 

Plus de Trevor Woerner (8)

Sensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiSensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPi
 
Yocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onYocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-on
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-On
 
GSoC/EVoC Overview
GSoC/EVoC OverviewGSoC/EVoC Overview
GSoC/EVoC Overview
 
Getting Started with Buildroot - Lab
Getting Started with Buildroot - LabGetting Started with Buildroot - Lab
Getting Started with Buildroot - Lab
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
 
OE Hands-On
OE Hands-OnOE Hands-On
OE Hands-On
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
 

Dernier

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Dernier (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

Getting Started with Buildroot

  • 1. SCaLE 17x Getting started with Buildroot Trevor Woerner trevor@toganlabs.com Copyright © 2019 Togán Labs Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions and translations are welcome! - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 1 of 40
  • 2. Trevor Woerner ▶ Senior Software Developer at Togán Labs ▶ Embedded Linux Development and Consulting ▶ Specialize in OpenEmbedded/Yocto ▶ Strong open-source focus - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 2 of 40
  • 3. Thomas Petazzoni ▶ Initially created this presentation ▶ CTO and Embedded Linux engineer at Bootlin ▶ major contributor to buildroot ▶ one of 3 people with commit access to buildroot ▶ Strong open-source focus Formerly Free Electrons - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 3 of 40
  • 4. Using an embedded Linux system ▶ the first thing you did at the very start of the labs ▶ has allowed you to do everything you’ve done with the board ▶ wrote one HUGE image to the SDcard – 3.4GB!! ▶ it took my laptop over 13 minutes - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 4 of 40
  • 5. Using an embedded Linux system ▶ what does the SDcard look like post-flashing? - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 5 of 40
  • 6. Using an embedded Linux system ▶ one big file was flashed, but the card now has partitions and lots of files ▶ works cross-platform (x86_64 host, ARM target) - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 6 of 40
  • 7. Using an embedded Linux system ▶ it’s all there in the *.img file - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 7 of 40
  • 8. Using an embedded Linux system ▶ it’s all there in the *.img file - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 8 of 40
  • 9. Can I build an embedded Linux system? ▶ with my own contents ▶ bootloader ▶ kernel ▶ init ▶ apps (→ dependencies) ▶ to target multiple devices ▶ within a certain size (smaller) ▶ containing only what a production device needs ▶ with the latest fixes ▶ built up from nothing, not simply imaging a disk (horse/cart) - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 9 of 40
  • 10. Can I build an embedded Linux system? YES! - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 10 of 40
  • 11. Can I build an embedded Linux system? Caveats: ▶ cross-compiling/toolchain ▶ find/get the sources (bzr, cvs, git, hg, scp, svn, wget, ...) can’t hope for pre-compiled ▶ checksum (md5, sha256, sha512, ...) ▶ dependencies ▶ unpack (gzip, bzip2, xz, zip, ...) ▶ patch ▶ configure ▶ build (make, cmake, ant, maven, waf, ninja, gyp, meson, ...) ▶ device-specific tweaks/tricks ▶ lots of choice, hard to get right ▶ one doesn’t slap together a cohesive, working set, by accident - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 11 of 40
  • 12. Can I build an embedded Linux system? problems: ▶ there is no ”one correct way” to write (open-source) software ▶ language ▶ repository system ▶ build system ▶ location ▶ licensing ▶ not enough developers consider cross-compilation solution: ▶ use an embedded Linux build system ▶ PLEASE don’t ”roll your own” - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 12 of 40
  • 13. Building an embedded Linux system + Readily available - Large, usually 100+ MB (→ GB!) - Not available for all architectures/devices - Not easy to customize - Generally require native compilation - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 13 of 40
  • 14. Building an embedded Linux system + Smaller and flexible - Very hard to handle cross-compilation and dependencies - Not reproducible - No benefit from other people’s work - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 14 of 40
  • 15. Building an embedded Linux system + Small and flexible + Reproducible, handles cross-compilation and dependencies + Available for virtually all architectures - One tool to learn - Build time - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 15 of 40
  • 16. Embedded Linux build system: principle ▶ Building from source → lot of flexibility - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 16 of 40
  • 17. Embedded Linux build system: principle ▶ Building from source → lot of flexibility ▶ Cross-compilation → leveraging fast build machines - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 17 of 40
  • 18. Embedded Linux build system: principle ▶ Building from source → lot of flexibility ▶ Cross-compilation → leveraging fast build machines ▶ Recipes for building components → easy - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 18 of 40
  • 19. Recipes, meta-data ▶ all embedded Linux build systems have: ▶ a tool for building the image (i.e. make) ▶ the recipes or meta-data describing how to handle each component ▶ where it’s located (github, gitlab, bitbucket, ...) ▶ how to fetch it (wget, svn, git, ...) ▶ patches ▶ how to build (make, meson, cmake, ...) ▶ configuration - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 19 of 40
  • 20. Buildroot at a glance ▶ Is an embedded Linux build system, builds from source: ▶ cross-compilation toolchain ▶ root filesystem with many libraries/applications, cross-built ▶ kernel and bootloader images ▶ Fast, simple root filesystem in minutes ▶ Easy to use and understand: kconfig and make ▶ Small root filesystem, default 2 MB ▶ Roughly 2170 packages available ▶ Generates filesystem images, not a distribution ▶ Vendor neutral ▶ Active community, stable releases every 3 months ▶ Started in 2001, oldest still maintained build system ▶ http://buildroot.org - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 20 of 40
  • 21. Getting started $ git clone git://git.busybox.net/buildroot $ cd buildroot $ make menuconfig - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 21 of 40
  • 22. Buildroot configuration 1. Target architecture ▶ Architecture ARC, ARM, Aarch64, csky, m68k, Microblaze, MIPS(64), NIOS II, OpenRISC, PowerPC(64), RISC-V, SuperH, SPARC(64), x86, x86_64, Xtensa ▶ Specific processor (variant) / Floating-point strategy ▶ ABI - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 22 of 40
  • 23. Buildroot configuration 1. Target architecture 2. Build options ▶ Download directory ▶ Number of parallel jobs ▶ Use of ccache ▶ Shared or static libraries ▶ etc. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 23 of 40
  • 24. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain ▶ Buildroot toolchain ▶ Buildroot builds the toolchain ▶ uClibc-ng, glibc, musl ▶ External toolchain ▶ Uses a pre-built toolchain ▶ Profiles for existing popular toolchains Linaro, Sourcery CodeBench, etc. ▶ Custom toolchains - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 24 of 40
  • 25. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration ▶ Init system to use: Busybox, Sysvinit, Systemd ▶ /dev management solution: static, devtmpfs, mdev, udev ▶ Hostname, password, getty terminal, etc. ▶ Root filesystem overlay ▶ Custom post build and post image scripts ▶ etc. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 25 of 40
  • 26. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel ▶ Kernel source (stable version, Git tree, patches) ▶ Kernel configuration ▶ Support for kernel extensions: RTAI, Xenomai, aufs, etc. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 26 of 40
  • 27. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages ▶ Roughly 2170 packages ▶ Qt5, X.org, Gtk, EFL ▶ GStreamer, ffmpeg ▶ Python, Perl, Ruby, Lua, Erlang ▶ Samba, OpenSSL, OpenSSH, dropbear, lighttpd ▶ OpenGL support for various platforms ▶ And many, many more libraries and utilities - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 27 of 40
  • 28. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages 7. Filesystem images ▶ Major filesystem formats supported ▶ axfs ▶ btrfs ▶ cloop ▶ cpio, for kernel initramfs ▶ cramfs ▶ ext2/3/4 ▶ f2fs ▶ jffs2 ▶ romfs ▶ squashfs ▶ tar ▶ ubifs ▶ yaffs2 - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 28 of 40
  • 29. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages 7. Filesystem images 8. Bootloaders ▶ Barebox ▶ Gummiboot ▶ Grub2 ▶ shim ▶ Syslinux ▶ U-Boot ▶ and more platform-specific bootloaders: imx-bootlets, at91bootstrap, etc. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 29 of 40
  • 30. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages 7. Filesystem images 8. Bootloaders 9. Host utilities ▶ Allows to build some native tools, useful for development. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 30 of 40
  • 31. Building and using ▶ To start the build: make ▶ Results in output/images: ▶ rootfs.ext4, root filesystem in ext4 format ▶ zImage, Linux kernel image ▶ am335x-pocketbeagle.dtb, Linux kernel Device Tree blob ▶ u-boot.img, U-Boot bootloader image ▶ MLO, U-Boot bootloader image ▶ Ready to be flashed on your embedded system. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 31 of 40
  • 32. Exploring the build output ▶ All the output produced by Buildroot is stored in output/ ▶ Can be customized using O= for out-of-tree build ▶ output/ contains ▶ output/build, with one sub-directory for the source code of each component ▶ output/host, which contains all native utilities needed for the build, including the cross-compiler ▶ output/host/<tuple>/sysroot, which contains all the headers and libraries built for the target ▶ output/target, which contains almost the target root filesystem ▶ output/images, the final images - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 32 of 40
  • 33. Summarized build process 1. Check core dependencies 2. For each selected package, after taking care of its dependencies: download, extract, patch, configure, build, install ▶ To target/ for target apps and libs ▶ To host/<tuple>/sysroot for target libs ▶ To host/ for native apps and libs ▶ Filesystem skeleton and toolchain are handled as regular packages 3. Copy rootfs overlay 4. Call post build scripts 5. Generate the root filesystem image 6. Call post image scripts - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 33 of 40
  • 34. Customizing the build Besides the existing packages and options, there are multiple ways to customize the generated root filesystem: ▶ Create custom post-build and/or post-image scripts ▶ Use a root filesystem overlay, recommended to add all your config files ▶ Add your own packages - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 34 of 40
  • 35. Adding a new package: Config.in package/libmicrohttpd/Config.in config BR2_PACKAGE_LIBMICROHTTPD bool "libmicrohttpd" depends on BR2_TOOLCHAIN_HAS_THREADS help GNU libmicrohttpd is a small C library that makes it easy to run an HTTP server as part of another application. http://www.gnu.org/software/libmicrohttpd/ comment "libmicrohttpd needs a toolchain w/ threads" depends on !BR2_TOOLCHAIN_HAS_THREADS package/Config.in [...] source "package/libmicrohttpd/Config.in" [...] - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 35 of 40
  • 36. Adding a new package: <pkg>.mk, <pkg>.hash package/libmicrohttpd/libmicrohttpd.mk LIBMICROHTTPD_VERSION = 0.9.59 LIBMICROHTTPD_SITE = $(BR2_GNU_MIRROR)/libmicrohttpd LIBMICROHTTPD_LICENSE = LGPL-2.1+ LIBMICROHTTPD_LICENSE_FILES = COPYING LIBMICROHTTPD_INSTALL_STAGING = YES LIBMICROHTTPD_CONF_OPT = --disable-curl --disable-examples $(eval $(autotools-package)) package/libmicrohttpd/libmicrohttpd.hash # Locally calculated sha256 9b9ccd7d0b11b0e17... libmicrohttpd-0.9.59.tar.gz sha256 70e12e2a60151b9ed... COPYING - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 36 of 40
  • 37. Adding a new package: infrastructures ▶ In order to factorize similar behavior between packages using the same build mechanism, Buildroot has package infrastructures ▶ autotools-package for autoconf/automake based packages ▶ cmake-package for CMake based packages ▶ python-package for Python Distutils and Setuptools based packages ▶ generic-package for non-standard build systems ▶ And more: luarocks-package, perl-package, rebar-package, kconfig-package, etc. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 37 of 40
  • 38. Defconfigs ▶ Pre-defined configurations for popular platforms ▶ They build a minimal system for the platform ▶ make <foobar>_defconfig to load one of them ▶ Some of the configs ▶ RasberryPi ▶ BeagleBone ▶ CubieBoard ▶ PandaBoard ▶ Many Atmel development boards ▶ Several Freescale i.MX6 boards ▶ Many Qemu configurations ▶ and more... ▶ make list-defconfigs for the full list - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 38 of 40
  • 39. Buildroot design principles ▶ Cross-compilation only: no support for doing development on the target. ▶ No package management system: Buildroot doesn’t generate a distribution, but a firmware ▶ Don’t be smart: if you do a change in the configuration and restarts the build, Buildroot doesn’t try to be smart. Only a full rebuild will guarantee the correct result. - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 39 of 40
  • 40. Documentation and support ▶ Extensive manual: https://buildroot.org/downloads/manual/manual.html ▶ 3-day training course, with freely available materials: https://bootlin.com/training/buildroot/ ▶ Mailing list: http://lists.busybox.net/pipermail/buildroot/ ▶ IRC channel: #buildroot on Freenode - Embedded Linux Experts - https://cm.e-ale.org/2019/SCaLE17x/buildroot 40 of 40