Buildroot vs. OpenEmbedded - Yocto Project
Buildroot vs. OpenEmbedded - Yocto Project
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 1/1
Alexandre Belloni
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 2/1
Thomas Petazzoni
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 3/1
Common aspects
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 4/1
Buildroot: general philosophy
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/1
Yocto Project: general philosophy
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 6/1
Buildroot: output
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 7/1
Yocto Project: output
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 8/1
Buildroot: configuration
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 9/1
Yocto Project: configuration
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 10/1
Buildroot: layers
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 11/1
Yocto Project: layers
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 12/1
Buildroot/Yocto Project: toolchain
Similar capabilities
I Building their own toolchains, based on gcc, a choice of C libraries (glibc, uClibc,
musl)
I Using pre-built external toolchains
I Somewhat easier in Buildroot, since it’s built-in
I Only really properly supported with additional vendor layers in the Yocto Project
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 13/1
Buildroot: new package
package/tmux/Config.in
config BR2_PACKAGE_TMUX
bool "tmux"
depends on BR2_USE_MMU # fork()
select BR2_PACKAGE_LIBEVENT
select BR2_PACKAGE_NCURSES
help
tmux is a terminal multiplexer, it enables a number of terminals
(or windows) to be accessed and controlled from a single terminal.
https://tmux.github.io/
package/tmux/tmux.mk
TMUX_VERSION = 2.1
TMUX_SITE = https://github.com/tmux/tmux/releases/download/$(TMUX_VERSION)
TMUX_LICENSE = ISC
TMUX_LICENSE_FILES = README
TMUX_DEPENDENCIES = libevent ncurses host-pkgconf
$(eval $(autotools-package))
package/tmux/tmux.hash
# Locally computed:
sha256 31564e7bf4bcef2de...f6176 tmux-2.1.tar.gz
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 14/1
Yocto Project: new package
meta-oe/recipes-extended/tmux/tmux 2.1.bb
SUMMARY = "Terminal multiplexer"
HOMEPAGE = "http://tmux.sourceforge.net"
SECTION = "console/utils"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://tmux.c;beginline=3;endline=17;md5=8685b4455...
SRC_URI = "git://github.com/tmux/tmux.git;branch=master"
SRCREV ?= "310f0a960ca64fa3809545badc629c0c166c6cd2"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 15/1
Buildroot: complexity
I Designed to be simple
I Every proposed feature for the core is analyzed in terms of
usefulness/complexity ratio
I Core logic written entirely in make, less than 1000 lines of code including 230 lines
of comments
I Really easy to understand what is going on, why and how a package is built
I Almost as simple as a shell script downloading, extracting, building and installing
your software components one after the other
I Detailed documentation, lots of resources/talks
I One hour talk sufficient to describe all the internals (ELCE 2014)
I Typical feedback on IRC: coming over from Yocto and very pleasantly surprised
how much easier it is. This is the first thing that’s stumped me
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 16/1
Yocto Project: complexity
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 17/1
Buildroot: number/variety of packages
I 1800+ packages
I Graphics: X.org, Wayland, Qt4/Qt5,
Gtk2/Gtk3, EFL
I Multimedia: Gstreamer 0.10/1.x, ffmpeg, Kodi,
OpenGL support for numerous platforms
I Languages: Python 2/3, PHP, Lua, Perl,
Erlang, Mono, Ruby, Node.js
I Networking: Apache, Samba, Dovecot, Exim,
CUPS, lots of servers/tools
I Init systems: Busybox (default), initsysv,
systemd
I No support for a toolchain on the target
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 18/1
Yocto Project: number/variety of packages
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 19/1
Buildroot: approach of dependencies
I Minimalistic approach
I if a feature can be disabled, it should be disabled by default
I Lots of automatic dependencies
I i.e., if you enable OpenSSL, you will automatically get SSL support in all other
packages you have enabled that can provide SSL support
I Leads to small root filesystems by default, with no effort
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 20/1
Yocto Project: approach of dependencies
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 21/1
Buildroot: updates/security
I Releases published every three months: two months of development, one month
stabilization.
I Every release includes updates of package versions: both security updates and
major updates.
I And also potentially changes in the core infrastructure.
I No LTS versions with only security updates so far, users are handling this on their
own, only for the packages they care about
I Script to assess the unfixed CVEs in a given Buildroot configuration is being
contributed.
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 22/1
Yocto Project: updates/security
I Releases published every six months: one release in April, one in October.
I Planning and roadmap is available on the wiki:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.1_Status
I Four milestones with 3 months between M1 and the final release
I At least the previous and the current releases have appointed maintainers, they
get security and important fixes but no recipe upgrade.
I Older releases are maintained by the community, on a best effort basis.
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 23/1
Buildroot: detection of configuration changes
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 24/1
Yocto Project: detection of configuration changes
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 25/1
Buildroot: architecture support
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 26/1
Yocto Project: architecture support
I In the core: ARM, MIPS, PowerPC, x86 and their 64-bit variants
I In separate layers:
I Microblaze, NIOSII
I Usually silicon vendors maintain their own BSP layers:
I meta-intel
I meta-altera (both ARM and NIOSII)
I meta-atmel, meta-fsl, meta-ti, ...
I meta-xilinx (both ARM and Microblaze)
I But also community effort:
I meta-rockchip, meta-sunxi, ...
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 27/1
Buildroot: minimal build
Minimal build (qemu_arm_versatile_defconfig) takes 15 minutes and 25 seconds,
image size is 2.2MB.
ALL
uclibc host-pkgconf
host-gcc-initial linux-headers
host-binutils host-mpc
host-mpfr
host-gmp
host-m4
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 28/1
Yocto Project: minimal build
Minimal build (core-image-minimal for qemuarm) takes 50 minutes and 47 seconds,
image size is 4.9MB. With an existing sstate-cache, it takes 1 minute 21 seconds.
python udev
openssl sysvinit pciutils busybox sqlite3 gdbm modutils-initscripts init-ifupdown gettext run-postinsts core-image-minimal module-init-tools
Native Toolchain
perl-native-runtime opkg-native unifdef-native texinfo-native opkg-utils-native quilt-native makedevs-native kern-tools-native update-rc.d-native gzip-native ldconfig-native gcc-cross-initial-arm glibc gcc-cross-arm glibc-initial gcc-runtime binutils-cross-arm gcc-source-5.2.0 linux-yocto base-passwd libusb-compat db readline bzip2 util-linux glib-2.0 kmod expat usbutils initscripts update-rc.d qemuwrapper-cross
libxslt-native libarchive-native git-native virtual/arm-oe-linux-gnueabi-libc-initial linux-libc-headers libgcc libgcc-initial virtual/arm-oe-linux-gnueabi-libc-for-gcc virtual/arm-oe-linux-gnueabi-binutils libtool-cross packagegroup-core-boot libusb1 libffi zlib opkg-utils netbase cryptodev-linux ncurses depmodwrapper-cross virtual/gettext virtual/libiconv libusb
binutils-native elfutils-native libpcre-native file-native sqlite3-native pigz-native cryptodev-linux-native bc-native ncurses-native mpfr-native glib-2.0-native kmod-native
byacc-native db-native popt-native virtual/libintl-native beecrypt-native bzip2-native ossp-uuid-native zlib-native bison-native flex-native lzo-native libffi-native pkgconfig-native xz-native gmp-native gperf-native gtk-doc-stub-native gettext-native
gettext-minimal-native libtool-native
automake-native
autoconf-native
m4-native
texinfo-dummy-native gnu-config-native
perl-native-runtime-native
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 29/1
License compliance
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 30/1
Buildroot/Yocto Project: choosing
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 31/1
Questions?
Alexandre Belloni
Thomas Petazzoni
[email protected]
[email protected]
- Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 32/1