SlideShare uma empresa Scribd logo
1 de 94
Baixar para ler offline
Buildroot vs Yocto:
Differences for Your Daily Job
Luca Ceresoli — AIM Sportline
luca@lucaceresoli.net
http://lucaceresoli.net
Linux-Lab 2018
About me
• Embedded Linux engineer
at AIM Sportline
• Kernel, drivers,
bootloader, FPGA,
build system
www.aim-sportline.com
• Open source enthusiast, contributor to Buildroot, the Linux
kernel and a few other projects
• Bergamo, Milan area, Italy
1
Introduction
This is not…
• This is not a tutorial
2
This is not…
• This is not a tutorial
• This is not a feature comparison, not a selection guide
2
This is not…
• This is not a tutorial
• This is not a feature comparison, not a selection guide
• If you need one:
• Buildroot vs. OpenEmbedded/Yocto: A Four Hands
Discussion,
Belloni and Petazzoni, ELC 2016 (slides and video online)
• http://www.jumpnowtek.com/linux/
Choosing-an-embedded-linux-build-system.html
• https://opensource.com/article/18/6/
embedded-linux-build-tools
2
This is not…
• This is not a tutorial
• This is not a feature comparison, not a selection guide
• If you need one:
• Buildroot vs. OpenEmbedded/Yocto: A Four Hands
Discussion,
Belloni and Petazzoni, ELC 2016 (slides and video online)
• http://www.jumpnowtek.com/linux/
Choosing-an-embedded-linux-build-system.html
• https://opensource.com/article/18/6/
embedded-linux-build-tools
• Fact: both tools have pros and cons
2
Similar…
In a nutshell:
a dependency graph
with actions to build each node.
3
…but different — based on different tools
Kconfig Make Bitbake
4
…but different — root filesystem VS distribution
Buildroot
Kernel Bootloader Root FS
Yocto
Packages (ipk, dpkg, rpm)
Kernel Bootloader Root FS
5
Contents
1 Introduction
2 Bootstrapping
3 Naming
4 Layers / external trees
5 Writing recipes
6 Building
7 Understanding what’s going on
8 Customizing the root filesystem
9 Tweaking recipes
10 Conclusions
6
Bootstrapping
Ingredients
• Get the sources
• git clone git://git.buildroot.net/buildroot; cd
buildroot
7
Ingredients
1. Get the Poky sources (bitbake, oe-core)
• git clone -b sumo git://git.yoctoproject.org/poky;
cd poky
2. You’ll probably need more recipes
• git clone -b sumo
git://git.openembedded.org/meta-openembedded
3. Additional layers can be useful
• SoC/board vendor BSP layer, additional software, …
• http://layers.openembedded.org
8
Configure
• Smooth start: find a defconfig for a similar board
• make list-defconfigs # minimal booting configs
• make similar_board_defconfig
• Or from scratch
• Find kernel and U-Boot sources that work for your SoC
• make menuconfig
• Target: architecture, CPU features
• Kernel: where to fetch it from, defconfig, dtbs
• U-Boot: where to fetch it from, defconfig
9
10
Configure
• . oe-init-build-env
• Creates and enters the build/ dir
• Smooth start: find a defconfig for a similar board
• ls conf/machine/ in your SoC vendor layer
• Set MACHINE ?= "<similar_machine>" in
conf/local.conf
11
Build
• make
• Without parameters builds “all”
12
Build
• bitbake <IMAGE>
• bitbake core-image-minimal
13
Naming
Building items
14
Package == Recipe
Rules to download and “build” a single program, library or other
(e.g. binutils, busybox, gcc, libxml2)
• Each package is a Make target
and has a Kconfig on/off knob
• make libxml2
• host-<PKG>: the same package
built for the development host
(native build)
• Each package is a Bitbake target
• bitbake libxml2
• <PKG>-native: the same
package built for the development
host (native build)
15
Step == Task
Each package requires several steps to be built
• No formal name, usually called just
steps
• source, extract, patch,
configure, build, install, …
• Each step is also a make target
• make libxml2-configure
host-binutils-build busybox
• The special <PKGNAME> make
target depends on all other normal
tasks required to ’build’ a recipe
• Called tasks
(often prefixed with do_)
• fetch, unpack, patch, configure,
compile, install, deploy, …
• First-class citizens in bitbake
• bitbake -c configure
libxml2 busybox
• The special build task depends on
all other normal tasks required to
’build’ a recipe
16
Default steps/tasks
install-target
build
configure
install-staging install-images
patch
extract
source
install
compile
configure
deploy
patch
unpack
fetch
17
Naming side-by-side
Package Recipe
Package Step Recipe Task
host-<PKG> <PKG>-native
pkg-generic.mk base.bbclass
source fetch
extract unpack
patch patch
configure configure
build compile
install-{target,staging} install
install-images deploy
18
Layers / external trees
Yocto: layers
The preferred way to add features: layers
conf/bblayers.conf
BBLAYERS ?= " 
/home/murray/devel/poky/meta 
/home/murray/devel/poky/meta-poky 
/home/murray/devel/poky/meta-yocto-bsp 
<...path to other layers...> 
"
19
Yocto: adding layers
BBLAYERS ?= " 
/home/murray/devel/poky/meta 
/home/murray/devel/poky/meta-poky 
/home/murray/devel/poky/meta-yocto-bsp 
+ ${TOPDIR}/../meta-my-soc-vendor 
+ ${TOPDIR}/../meta-openembedded/meta-oe 
"
• Suggestion: use relative paths
20
Yocto: .bbappend
• .bbappend files are appended to the .bb file while parsing
• Change variable values
• Append/prepend to tasks
• The resulting myrecipe is a concatenation of:
• <LAYER1>/*/*/myrecipe.bb
• <LAYER2>/*/*/myrecipe.bbappend
• <LAYER3>/*/*/myrecipe.bbappend
21
Yocto: issues with layers
• Some SoC vendor layers augment the buildsystem, at times
creating problems
• Conflict between layers (e.g. in gstreamer)
• Suggestion: add layers one by one, bottom-up, test each time
• Problems?
• Fix the offending code in your layer (.bbappend)
• disable the recipe (PNBLACKLIST) and provide an alternative
• Don’t use the layer, copy only what you need
22
Yocto: your top-level layer
• Add your top-level layer
• Your machine configuration
• Your proprietary packages
• .bbappends and other files to modify the behaviour of lower
layers
23
Buildroot: BR2_EXTERNAL
• BR2_EXTERNAL is technically similar to Yocto layers, but
simpler
• The goal is to add, not modify
• Typical use: add your own product customizations
• packages
• Kconfig options
• defconfigs
• boards
• patches
• …
• Need to fix/improve a Buildroot package?
• Suggested policy: do it in the Buildroot code, then submit
your improvements upstream
24
Buildroot: BR2_EXTERNAL
$ make BR2_EXTERNAL=~/myext:~/myext2 menuconfig
• The list of your externals is saved internally
(.output/.br-external.mk)
• The top-level Makefile will include each external Makefile
• The same for Config.in files
25
Writing recipes
Overall recipe directory layout
<BUILDROOT> <LAYER>
recipes-*package
*
myrecipe_1.0.bb
files
fix-bug.patch
mypackage.hash
mypackage.mk
Config.in
mypackage
0001-fix-bug.patch
26
A simple Yocto package: the .bb file
<MYLAYER>/recipes-app/corporate-apps/foo_1.0.bb
SRC_URI = "http://www.foo.org/download/foo-${PV}.tar.xz"
DEPENDS = "libbar-native libusb"
do_compile() {
oe_runmake all
}
do_install() {
install -D -m 0755 ${B}/foo ${D}${bindir}/foo
}
27
A simple Buildroot package: the makefile
package/foo/foo.mk
FOO_VERSION = 1.0
FOO_SITE = http://www.foo.org/download
FOO_DEPENDENCIES = host-libbar libusb
define FOO_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all
endef
define FOO_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/foo $(TARGET_DIR)/usr/bin/foo
endef
$(eval $(generic-package))
28
A simple Buildroot package: Config.in
• Shows the package in the Kconfig interfaces
• Uses the Kconfig language
package/foo/Config.in
config BR2_PACKAGE_FOO
bool "foo"
select BR2_PACKAGE_LIBUSB
help
A brief description.
29
Yocto classes
• classes implement common features for reuse in recipes
• .bbclass files
• There are classes for the most common build tools: Autotools,
CMake
<MYLAYER>/recipes-app/corporate-apps/foo_1.0.bb
SRC_URI = "http://www.foo.org/download/foo-${PV}.tar.xz"
DEPENDS = "libbar-native libusb"
inherit autotools
30
Buildroot package infrastructures
• package infrastructures are classes of packages that use the
same build tool
• Autotools, CMake, Python, LuaRocks, Perl/CPAN …
• Most commands have a default
package/foo/foo.mk
FOO_VERSION = 1.0
FOO_SITE = http://www.foo.org/download
FOO_DEPENDENCIES = host-libbar libusb
$(eval $(autotools-package))
31
Yocto classes
• With classes the common do_<TASK> functions are already set
• Customizable via infrastructure-specific variables
EXTRA_OECONF += "--enable-warp-speed"
• Can be extended with
• do_<TASK>_prepend
• do_<TASK>_append
do_install_append() {
touch ${D}${sysconfdir}/foo.conf
}
32
Buildroot package infrastructures
• With package infrastructures FOO_<STEP>_CMDS are already
set
• Customizable via infrastructure-specific variables
FOO_CONF_OPTS = --enable-warp-speed
• To extend them define hooks
• FOO_PRE_<STEP>_HOOKS
• FOO_POST_<STEP>_HOOKS
define FOO_CREATE_CONF_FILE
touch $(TARGET_DIR)/etc/foo.conf
endef
FOO_POST_INSTALL_HOOKS += FOO_CREATE_CONF_FILE
33
Predefined variables
Lots of predefined variables can (and should) be user in rules. The
most widely used:
Buildroot Yocto
Package name <PKG>_NAME PN
Package raw name <PKG>_RAWNAME BPN
Package version <PKG>_VERSION PV
Source code dir <PKG>_SRCDIR S
Build dir <PKG>_BUILDDIR B
Install files in (*) TARGET_DIR D
Install images in (*) BINARIES_DIR DEPLOYDIR
* The final dirs in Buildroot, temp dirs in Yocto.
34
Adding patches
Buildroot Yocto
.patch file in package dir .patch file in recipe subdir (*)
<PKG>_PATCH = <URL> SRC_URI += <URL>
BR2_GLOBAL_PATCH_DIR tree Your layer
* Plus SRC_URI += "file://foo.patch"
(and FILESEXTRAPATHS_prepend = "<DIR>:")
35
Building
Invoking
Buildroot Yocto
make [all] bitbake <IMAGE>
make busybox bitbake busybox
make busybox-configure bitbake -c configure busybox
make busybox-reconfigure bitbake -C configure busybox
make clean bitbake -c clean world
make busybox-dirclean bitbake -c clean busybox
36
Tuning resource usage
Buildroot Yocto
BR2_JLEVEL=2 make PARALLEL_MAKE="-j 2" bitbake ...
— BB_NUMBER_THREADS=2 bitbake ...
Build options → Enable compiler cache —
— SSTATE_DIR ?= " /.sstate-cache"
37
Buildroot: out-of-tree builds
• make O=foo foo_defconfig
• make O=bar bar_defconfig
• cd foo; make
• Build in foo/* instead of output/*
38
Buildroot: out-of-tree builds
• make O=foo foo_defconfig
• make O=bar bar_defconfig
• cd foo; make
• Build in foo/* instead of output/*
• cd bar; make
• Can run in parallel
38
Yocto: multiple machines and images
• bitbake core-image-minimal
• bitbake my-image-huge
• Recycles common artifacts
39
Yocto: multiple machines and images
• bitbake core-image-minimal
• bitbake my-image-huge
• Recycles common artifacts
• MACHINE=another-board bitbake my-image-huge
• Remember to use ?= to set MACHINE in your conf file
39
Buildroot dependency tracking: stamp files
• Dependency tracking is at the core of Make (program → .o →
.c)
• Does not fit completely the needs of a buildsystem
• Internally Buildroot touches a stamp file after completing
each step
• An empty file
• Tracks successful step completion, not the rules that originated
it
• If the rules change, Buildroot is unaware
40
Buildroot dependency tracking: stamp files
• You need to manually trigger a rebuild when:
• You changed the configuation of the package or one of its
dependencies
• You’re developing the package and changed the rules (.mk,
patches…)
• How to rebuild
• The safe option: make clean; make
• If you know what you really need: make <PKG>-dirclean
<PKG>
• Or make <PKG>-reconfigure / make <PKG>-rebuild
41
Yocto: recipe hash
• Bitbake stores a hash for each task
• Hash content:
• All the recipe variables and task code (bitbake -e)
• Content of all files stored in SRC_URI
• Automatically detect recipe changes and rebuilds what’s
needed
• Result stores in the sstate cache for later reuse
42
Yocto: recipe hash
• Still want to force a task?
• bitbake -f -c configure <PKG>
• -f forces to run tasks even when not needed
43
Where are my output files?
43
Work directory layout
<TOP> <--CWD <TOP>
build <--CWD
output tmp
build work
<TUPLE>
busybox
1.27.2-r0
busybox-1.29.2 busybox-1.27.2
image
package
packages-split
build
44
Root filesystem generation
<TOP> <--CWD <TOP>
build <--CWD
output tmp
work
<MACHINE TUPLE>
core-image-minimal
1.0-r0
target rootfs
bin, usr...bin, usr...
45
Output directory layout
<TOP> <--CWD <TOP>
build <--CWD
output tmp
images
deploy
images
<MACHINE>
u.boot.*
*Image
<IMG>-<MACHINE>.<EXT>
*.dtb
rootfs.<EXT>
*Image
*.dtb
u-boot.*
sdcard.img
46
Understanding what’s going on
What will it build?
46
Buildroot: graph-depends
• make graph-depends
• Produces output/graphs/graph-depends.pdf
ALL
busybox host-dosfstools
host-genimage
host-mtools
host-patchelf
ifupdown-scripts initscripts
linux
skeleton toolchain
uboot
rootfs-ext2
rootfs-tar
host-lzip
host-skeleton
host-libconfuse
host-pkgconf
host-bisonhost-flex
host-kmod
host-m4
host-gettext
host-automakehost-libxml2
host-autoconf
host-libtool
skeleton-init-sysv
skeleton-init-common
toolchain-buildroot
host-gcc-final
uclibc
host-gcc-initial
linux-headers
host-binutils
host-mpc
host-mpfr
host-gmp
host-dtc
host-e2fsprogs rootfs-common
host-util-linux
host-zlib
host-libzlib
host-fakeroot
host-makedevshost-acl
host-attr
47
Buildroot: graph-depends
• Build a per-package graph: <PKG>-graph-depends
• Set BR2_GRAPH_DEPS_OPTS in the environment to control the
output
• BR2_GRAPH_DEPS_OPTS="--exclude=host" make
avahi-graph-depends
• Produces output/graphs/avahi-graph-depends.pdf
avahi
dbus libdaemon
expat
48
Yocto: taskexp
• Generating dot graphs not really usable
• Task Explorer: bitbake -g -u taskexp world
• Shows dependencies between tasks (not recipes)
49
What does it do?
What went wrong?
49
Buildroot: default output
$ make
...
>>> host-e2fsprogs 1.44.2 Extracting
xzcat /home/murray/src/e2fsprogs/e2fsprogs-1.44.2.tar.xz...
>>> host-e2fsprogs 1.44.2 Patching
>>> host-e2fsprogs 1.44.2 Configuring
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
...
• “>>>” marks the started tasks
• The whole output of each step follows
• Failure? Look at the last lines
50
Buildroot: concise output
$ ./utils/brmake
...
2018-10-06T16:15:58 >>> host-zlib Patching
2018-10-06T16:15:58 >>> host-zlib Configuring
2018-10-06T16:15:58 >>> host-zlib Building
2018-10-06T16:15:58 >>> host-zlib Installing to host directory
2018-10-06T16:15:58 >>> host-util-linux 2.32.1 Patching
...
• Adds step start time
• Verbose output saved in br.log
51
Yocto: default output
• The default output shows the current status, no logs
• Hides completed tasks
Currently 4 running tasks (119 of 2503) 4% |## |
0: glibc-initial-2.27-r0 do_fetch (pid 5216) 38% |############ | 4.09M/s
1: glibc-2.27-r0 do_fetch - 4s (pid 5261)
2: ncurses-native-6.0+20171125-r0 do_fetch (pid 6147) | <=> |
3: elfutils-native-0.170-r0 do_fetch (pid 7143) 11% |### | 2.49M/s
52
Yocto: concise “log” output
• To see the completed tasks:
• bitbake ... | cat
NOTE: Running task 119 of 2645 (.../binutils/binutils-cross_2.30.bb:do_unpack)
NOTE: Running task 232 of 2645 (virtual:native:...lzo/lzo_2.10.bb:do_compile)
NOTE: recipe binutils-cross-arm-2.30-r0: task do_unpack: Started
NOTE: recipe binutils-cross-arm-2.30-r0: task do_prepare_recipe_sysroot: Started
NOTE: recipe elfutils-native-0.170-r0: task do_prepare_recipe_sysroot: Started
NOTE: recipe lzo-native-2.10-r0: task do_compile: Started
NOTE: recipe elfutils-native-0.170-r0: task do_prepare_recipe_sysroot: Succeeded
NOTE: Running task 247 of 2645 (virtual:native:.../elfutils_0.170.bb:do_configure)
NOTE: recipe binutils-cross-arm-2.30-r0: task do_prepare_recipe_sysroot: Succeeded
53
Yocto: inspect build logs
• Failure?
• For each task a log file is saved
• in
tmp/work/<TUPLE>/<RECIPE>/<VERSION>/temp/log.do_<TASK>
• e.g.
tmp/work/x86_64-linux/gmp-native/6.1.2-r0/temp/log.do_configure
• Or re-run the failed task with verbose output to see its output
on your terminal
• bitbake -v -f -c configure gmp-native
54
What is it thinking?
54
Buildroot: printvars
• make -s printvars
• Print all variables
• make -s VARS=BUSYBOX_% printvars
• Only variables matching a pattern
• make -s RAW_VARS=YES printvars
• Print unexpanded values
• make -qp
• Print the whole Make database
• Variables (before expansion) and the file where they were set
• Rules (target + prerequisites + actions)
55
Yocto: bitbake -e
• bitbake -e
• Show the global environment
• Variables and the files where they were set
• bitbake -e <RECIPE>
• Show the per-recipe environment
• Variables and the files where they were set
• Tasks actions
56
Customizing the root filesystem
Buildroot: Kconfig
• The same configuration system as the kernel, Busybox,
U-Boot, Barebox…
• make menuconfig, make xconfig
• .config is your current configuration
• make savedefconfig updates your defconfig with the new
values
57
Yocto: .bb files
• Your “configuration” is in several .bb files.
• A common layout:
• Build options, toolchain, MACHINE: a conf file in your top layer
(or build/conf/local.conf)
• Target options, kernel and bootloader selection: in your layer
conf/machine/<MACHINE>.bb
• System configuration: various recipes, other places
• Packages to put in rootfs: image recipe (see later)
58
Buildroot: adding packages
• make menuconfig → Packages
• Search, add, remove, change packages
• make clean (if you changed or remove packages)
• make
59
Yocto: adding packages
• Find the package you need
• bitbake-layers show-recipes
• http://layers.openembedded.org/layerindex/branch/
master/recipes/
• Create your own image recipe
• Image = list of packages to but in rootfs (a subset of all the
packages)
60
Yocto: adding packages
• Create an image recipe
(<MYLAYER>/recipes-*/images/*-image-*.bb)
require recipes-core/images/core-image-minimal.bb
DESCRIPTION = "My own root filesystem"
LICENSE = "MIT"
IMAGE_FSTYPES = "tar.gz"
IMAGE_INSTALL += "htop packagegroup-debug"
• Package groups
(<MYLAYER>/recipes-*/packagegroups/packagegroup-*.bb)
inherit packagegroup
RDEPENDS_${PN} = "gdb strace"
61
Typical root filesystem customizations
• And embedded systems needs customizations
• High-level choices: init system, /dev management, locales…
• Creation of users, passwords, assorted files, …
• And many more
• Buildroot
• make menuconfig → System configuration
• Yocto
• Add appropriate lines to your conf, board or image files
• Search the Yocto reference manual
https://www.yoctoproject.org/docs/current/
ref-manual/ref-manual.html
• Grep the poky source code
62
Some system settings, side-by-side
Buildroot Yocto
System hostname hostname_pn-base-files = "mybox"
System banner DISTRO_NAME_pn-base-files = "Welcome",
DISTRO_VERSION_pn-base-files = ""
Init system VIRTUAL-RUNTIME_init_manager
/dev management VIRTUAL-RUNTIME_dev_manager
Root password IMAGE_FEATURES += "empty-root-password"
Users tables inherit extrausers;
EXTRA_USERS_PARAMS = "usermod -P 1876*18 root;"
63
Other rootfs customizations
• Buildroot: System configuration menu:
• Root filesystem overlay directories
• Post-build and post-image scripts
• Yocto
• ROOTFS_POSTPROCESS_COMMAND and
IMAGE_POSTPROCESS_COMMAND
64
Tweaking recipes
Configuring Kconfig-based packages
• Buildroot
• Based on kconfig-package
• Kconfig packages: at91bootstrap3, barebox, uboot, linux,
busybox, linux-backports, swupdate, uclibc, xvisor
• Yocto
• Inherit the obscure cml1 class
• Kconfig packages in the Poky layer: linux, busybox (not
U-Boot)
65
Configuring Kconfig-based packages
Description Buildroot Yocto
Enter menu make <PKG>-menuconfig bitbake -c menuconfig <RCP>
Save defconfig make <PKG>-savedefconfig bitbake -c savedefconfig <RCP>
Update defconfig make <PKG>-update-defconfig —
Extract fragment — bitbake -c diffconfig <RCP>
66
Yocto: (re)assigning variables
• Assignments
• F := "foo-${A}" — Immediate expansion
• F = "foo-${A}" — Expansion on usage
• Weak assignments: used for values the user is supposed to
customize
• Base layer .bb: VAR ??= "white"
• Middle layer .bbappend: VAR ?= "black"
• Top-level layer.bbappend: VAR = "green"
• The recipe will use VAR = "green"
• Append or prepend
• VAR += "val", VAR =+ "val" (adds spaces)
• VAR_append = "val", VAR_prepend = "val" (does not add
spaces)
• VAR_remove = "val"
67
Buildroot: (re)assigning variables
• It’s a Makefile, use the Make syntax
• Assignments
• F := "foo-$(VER)" — Immediate expansion
• F = "foo-$(VER)" — Expansion on usage
• Append or prepend
• VAR = "$(VAR) extra", VAR = "extra $(VAR)"
68
More string processing
• Buildroot
• Make has several functions for transforming text
• Example: VAR = $(filter-out bug, foo bug bar)
• Yocto
• If Bitbake is not enough, use Python
• PV_x = "${@'.'.join('${PV}'.split('.')[0:2] +
['x'])}"
”10.11.12” → ”10.11.x”
69
Yocto: changing task code
do_conf_append() {
echo CONFIG_ACS >>${D}/.config
}
do_install_prepend() {
mkdir -p ${D}${bindir}
}
• Append or prepend code
• Final task code =
concatenation of prepends + base + appends
• Don’t mix Bash and Python
70
Buildroot: changing task code
define FOO_ENABLE_ACS
echo CONFIG_ACS >>$(@D)/.config
endef
FOO_POST_CONFIGURE_HOOKS += FOO_ENABLE_ACS
define FOO_CREATE_BIN_DIR
mkdir -p $(TARGET_DIR)/bin
endef
FOO_PRE_INSTALL_HOOKS += FOO_CREATE_BIN_DIR
• Append or prepend code
• Final Make rule actions =
concatenation of pre-hooks + base + post-hooks
71
Conclusions
Thank you for your attention
Questions?
Luca Ceresoli
luca@lucaceresoli.net
http://lucaceresoli.net
© Copyright 2018, Luca Ceresoli. Slides released under
Creative Commons Attribution - Share Alike 3.0 License
https://creativecommons.org/licenses/by-sa/3.0/
72
Extra slides
Working with local sources
• Use sources from a local directory
• Not managed by the build system
• Useful during application development
• Buildroot
• <PKG>_OVERRIDE_SRCDIR=/my/src/tree make
• Skips source, extract, patch
• rsyncs from /my/src/tree before building
• Yocto
• inherit externalsrc
• EXTERNALSRC = "/my/src/tree"
• fetch, unpack, patch
• Points S to /my/src/tree

Mais conteúdo relacionado

Mais procurados

Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
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
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernelAdrian Huang
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)shimosawa
 
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
 
Linux Porting
Linux PortingLinux Porting
Linux PortingChamp Yen
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerSherif Mousa
 
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...Marco Cavallini
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introductionYi-Hsiu Hsu
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 

Mais procurados (20)

Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
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
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
 
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
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution Maker
 
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Linux Device Driver’s
Linux Device Driver’sLinux Device Driver’s
Linux Device Driver’s
 
linux device driver
linux device driverlinux device driver
linux device driver
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 

Semelhante a Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job

yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notesSteve Arnold
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in EnglishOtavio Salvador
 
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 : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux DistributionYocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux Distributionemertxemarketing
 
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 EasyBuild - Tutorial Part 2
Getting Started with EasyBuild - Tutorial Part 2Getting Started with EasyBuild - Tutorial Part 2
Getting Started with EasyBuild - Tutorial Part 2inside-BigData.com
 
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
 The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
The Latest Status of CE Workgroup Shared Embedded Linux Distribution ProjectYoshitake Kobayashi
 
Buildroot easy embedded system
Buildroot easy embedded systemBuildroot easy embedded system
Buildroot easy embedded systemNirma University
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
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
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKMarco Cavallini
 
DevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoDevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoMagento Dev
 
Package management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxPackage management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxDonnie Berkholz
 
[Webinar] An Introduction to the Yocto Embedded Framework
[Webinar] An Introduction to the Yocto Embedded Framework[Webinar] An Introduction to the Yocto Embedded Framework
[Webinar] An Introduction to the Yocto Embedded FrameworkICS
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practicesDaniel Pfeifer
 
An Introduction to the Yocto Embedded Framework 2018
An Introduction to the Yocto Embedded Framework 2018An Introduction to the Yocto Embedded Framework 2018
An Introduction to the Yocto Embedded Framework 2018ICS
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems Mender.io
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemLinaro
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yoctoAlex Gonzalez
 

Semelhante a Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job (20)

yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notes
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 
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 : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux DistributionYocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux Distribution
 
Yocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onYocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-on
 
Getting Started with EasyBuild - Tutorial Part 2
Getting Started with EasyBuild - Tutorial Part 2Getting Started with EasyBuild - Tutorial Part 2
Getting Started with EasyBuild - Tutorial Part 2
 
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
 The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
 
Buildroot easy embedded system
Buildroot easy embedded systemBuildroot easy embedded system
Buildroot easy embedded system
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
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
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
 
DevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoDevHub 3 - Composer plus Magento
DevHub 3 - Composer plus Magento
 
Package management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxPackage management and creation in Gentoo Linux
Package management and creation in Gentoo Linux
 
[Webinar] An Introduction to the Yocto Embedded Framework
[Webinar] An Introduction to the Yocto Embedded Framework[Webinar] An Introduction to the Yocto Embedded Framework
[Webinar] An Introduction to the Yocto Embedded Framework
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
 
Building Embedded Linux UDOONEO
Building Embedded Linux UDOONEOBuilding Embedded Linux UDOONEO
Building Embedded Linux UDOONEO
 
An Introduction to the Yocto Embedded Framework 2018
An Introduction to the Yocto Embedded Framework 2018An Introduction to the Yocto Embedded Framework 2018
An Introduction to the Yocto Embedded Framework 2018
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating System
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 

Mais de linuxlab_conf

Jonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel ReportJonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel Reportlinuxlab_conf
 
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
 
Bruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocketBruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocketlinuxlab_conf
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systemsClaudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systemslinuxlab_conf
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitlinuxlab_conf
 
Jacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complexJacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complexlinuxlab_conf
 
Alessio Lama - Development and testing of a safety network protocol
Alessio Lama - Development and testing of a safety network protocolAlessio Lama - Development and testing of a safety network protocol
Alessio Lama - Development and testing of a safety network protocollinuxlab_conf
 
Emanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2NEmanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2Nlinuxlab_conf
 
Dario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugsDario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugslinuxlab_conf
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...linuxlab_conf
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...linuxlab_conf
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Golinuxlab_conf
 
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on LinuxTommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linuxlinuxlab_conf
 
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdateAngelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdatelinuxlab_conf
 
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...linuxlab_conf
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionlinuxlab_conf
 
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvmLuca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvmlinuxlab_conf
 

Mais de linuxlab_conf (18)

Jonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel ReportJonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel Report
 
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...
 
Bruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocketBruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocket
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systemsClaudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
Jacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complexJacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complex
 
Alessio Lama - Development and testing of a safety network protocol
Alessio Lama - Development and testing of a safety network protocolAlessio Lama - Development and testing of a safety network protocol
Alessio Lama - Development and testing of a safety network protocol
 
Emanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2NEmanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2N
 
Dario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugsDario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugs
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Go
 
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on LinuxTommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
 
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdateAngelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
 
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruption
 
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvmLuca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
 

Último

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 

Último (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 

Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job

  • 1. Buildroot vs Yocto: Differences for Your Daily Job Luca Ceresoli — AIM Sportline luca@lucaceresoli.net http://lucaceresoli.net Linux-Lab 2018
  • 2. About me • Embedded Linux engineer at AIM Sportline • Kernel, drivers, bootloader, FPGA, build system www.aim-sportline.com • Open source enthusiast, contributor to Buildroot, the Linux kernel and a few other projects • Bergamo, Milan area, Italy 1
  • 4. This is not… • This is not a tutorial 2
  • 5. This is not… • This is not a tutorial • This is not a feature comparison, not a selection guide 2
  • 6. This is not… • This is not a tutorial • This is not a feature comparison, not a selection guide • If you need one: • Buildroot vs. OpenEmbedded/Yocto: A Four Hands Discussion, Belloni and Petazzoni, ELC 2016 (slides and video online) • http://www.jumpnowtek.com/linux/ Choosing-an-embedded-linux-build-system.html • https://opensource.com/article/18/6/ embedded-linux-build-tools 2
  • 7. This is not… • This is not a tutorial • This is not a feature comparison, not a selection guide • If you need one: • Buildroot vs. OpenEmbedded/Yocto: A Four Hands Discussion, Belloni and Petazzoni, ELC 2016 (slides and video online) • http://www.jumpnowtek.com/linux/ Choosing-an-embedded-linux-build-system.html • https://opensource.com/article/18/6/ embedded-linux-build-tools • Fact: both tools have pros and cons 2
  • 8. Similar… In a nutshell: a dependency graph with actions to build each node. 3
  • 9. …but different — based on different tools Kconfig Make Bitbake 4
  • 10. …but different — root filesystem VS distribution Buildroot Kernel Bootloader Root FS Yocto Packages (ipk, dpkg, rpm) Kernel Bootloader Root FS 5
  • 11. Contents 1 Introduction 2 Bootstrapping 3 Naming 4 Layers / external trees 5 Writing recipes 6 Building 7 Understanding what’s going on 8 Customizing the root filesystem 9 Tweaking recipes 10 Conclusions 6
  • 13. Ingredients • Get the sources • git clone git://git.buildroot.net/buildroot; cd buildroot 7
  • 14. Ingredients 1. Get the Poky sources (bitbake, oe-core) • git clone -b sumo git://git.yoctoproject.org/poky; cd poky 2. You’ll probably need more recipes • git clone -b sumo git://git.openembedded.org/meta-openembedded 3. Additional layers can be useful • SoC/board vendor BSP layer, additional software, … • http://layers.openembedded.org 8
  • 15. Configure • Smooth start: find a defconfig for a similar board • make list-defconfigs # minimal booting configs • make similar_board_defconfig • Or from scratch • Find kernel and U-Boot sources that work for your SoC • make menuconfig • Target: architecture, CPU features • Kernel: where to fetch it from, defconfig, dtbs • U-Boot: where to fetch it from, defconfig 9
  • 16. 10
  • 17. Configure • . oe-init-build-env • Creates and enters the build/ dir • Smooth start: find a defconfig for a similar board • ls conf/machine/ in your SoC vendor layer • Set MACHINE ?= "<similar_machine>" in conf/local.conf 11
  • 18. Build • make • Without parameters builds “all” 12
  • 19. Build • bitbake <IMAGE> • bitbake core-image-minimal 13
  • 22. Package == Recipe Rules to download and “build” a single program, library or other (e.g. binutils, busybox, gcc, libxml2) • Each package is a Make target and has a Kconfig on/off knob • make libxml2 • host-<PKG>: the same package built for the development host (native build) • Each package is a Bitbake target • bitbake libxml2 • <PKG>-native: the same package built for the development host (native build) 15
  • 23. Step == Task Each package requires several steps to be built • No formal name, usually called just steps • source, extract, patch, configure, build, install, … • Each step is also a make target • make libxml2-configure host-binutils-build busybox • The special <PKGNAME> make target depends on all other normal tasks required to ’build’ a recipe • Called tasks (often prefixed with do_) • fetch, unpack, patch, configure, compile, install, deploy, … • First-class citizens in bitbake • bitbake -c configure libxml2 busybox • The special build task depends on all other normal tasks required to ’build’ a recipe 16
  • 25. Naming side-by-side Package Recipe Package Step Recipe Task host-<PKG> <PKG>-native pkg-generic.mk base.bbclass source fetch extract unpack patch patch configure configure build compile install-{target,staging} install install-images deploy 18
  • 27. Yocto: layers The preferred way to add features: layers conf/bblayers.conf BBLAYERS ?= " /home/murray/devel/poky/meta /home/murray/devel/poky/meta-poky /home/murray/devel/poky/meta-yocto-bsp <...path to other layers...> " 19
  • 28. Yocto: adding layers BBLAYERS ?= " /home/murray/devel/poky/meta /home/murray/devel/poky/meta-poky /home/murray/devel/poky/meta-yocto-bsp + ${TOPDIR}/../meta-my-soc-vendor + ${TOPDIR}/../meta-openembedded/meta-oe " • Suggestion: use relative paths 20
  • 29. Yocto: .bbappend • .bbappend files are appended to the .bb file while parsing • Change variable values • Append/prepend to tasks • The resulting myrecipe is a concatenation of: • <LAYER1>/*/*/myrecipe.bb • <LAYER2>/*/*/myrecipe.bbappend • <LAYER3>/*/*/myrecipe.bbappend 21
  • 30. Yocto: issues with layers • Some SoC vendor layers augment the buildsystem, at times creating problems • Conflict between layers (e.g. in gstreamer) • Suggestion: add layers one by one, bottom-up, test each time • Problems? • Fix the offending code in your layer (.bbappend) • disable the recipe (PNBLACKLIST) and provide an alternative • Don’t use the layer, copy only what you need 22
  • 31. Yocto: your top-level layer • Add your top-level layer • Your machine configuration • Your proprietary packages • .bbappends and other files to modify the behaviour of lower layers 23
  • 32. Buildroot: BR2_EXTERNAL • BR2_EXTERNAL is technically similar to Yocto layers, but simpler • The goal is to add, not modify • Typical use: add your own product customizations • packages • Kconfig options • defconfigs • boards • patches • … • Need to fix/improve a Buildroot package? • Suggested policy: do it in the Buildroot code, then submit your improvements upstream 24
  • 33. Buildroot: BR2_EXTERNAL $ make BR2_EXTERNAL=~/myext:~/myext2 menuconfig • The list of your externals is saved internally (.output/.br-external.mk) • The top-level Makefile will include each external Makefile • The same for Config.in files 25
  • 35. Overall recipe directory layout <BUILDROOT> <LAYER> recipes-*package * myrecipe_1.0.bb files fix-bug.patch mypackage.hash mypackage.mk Config.in mypackage 0001-fix-bug.patch 26
  • 36. A simple Yocto package: the .bb file <MYLAYER>/recipes-app/corporate-apps/foo_1.0.bb SRC_URI = "http://www.foo.org/download/foo-${PV}.tar.xz" DEPENDS = "libbar-native libusb" do_compile() { oe_runmake all } do_install() { install -D -m 0755 ${B}/foo ${D}${bindir}/foo } 27
  • 37. A simple Buildroot package: the makefile package/foo/foo.mk FOO_VERSION = 1.0 FOO_SITE = http://www.foo.org/download FOO_DEPENDENCIES = host-libbar libusb define FOO_BUILD_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all endef define FOO_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/foo $(TARGET_DIR)/usr/bin/foo endef $(eval $(generic-package)) 28
  • 38. A simple Buildroot package: Config.in • Shows the package in the Kconfig interfaces • Uses the Kconfig language package/foo/Config.in config BR2_PACKAGE_FOO bool "foo" select BR2_PACKAGE_LIBUSB help A brief description. 29
  • 39. Yocto classes • classes implement common features for reuse in recipes • .bbclass files • There are classes for the most common build tools: Autotools, CMake <MYLAYER>/recipes-app/corporate-apps/foo_1.0.bb SRC_URI = "http://www.foo.org/download/foo-${PV}.tar.xz" DEPENDS = "libbar-native libusb" inherit autotools 30
  • 40. Buildroot package infrastructures • package infrastructures are classes of packages that use the same build tool • Autotools, CMake, Python, LuaRocks, Perl/CPAN … • Most commands have a default package/foo/foo.mk FOO_VERSION = 1.0 FOO_SITE = http://www.foo.org/download FOO_DEPENDENCIES = host-libbar libusb $(eval $(autotools-package)) 31
  • 41. Yocto classes • With classes the common do_<TASK> functions are already set • Customizable via infrastructure-specific variables EXTRA_OECONF += "--enable-warp-speed" • Can be extended with • do_<TASK>_prepend • do_<TASK>_append do_install_append() { touch ${D}${sysconfdir}/foo.conf } 32
  • 42. Buildroot package infrastructures • With package infrastructures FOO_<STEP>_CMDS are already set • Customizable via infrastructure-specific variables FOO_CONF_OPTS = --enable-warp-speed • To extend them define hooks • FOO_PRE_<STEP>_HOOKS • FOO_POST_<STEP>_HOOKS define FOO_CREATE_CONF_FILE touch $(TARGET_DIR)/etc/foo.conf endef FOO_POST_INSTALL_HOOKS += FOO_CREATE_CONF_FILE 33
  • 43. Predefined variables Lots of predefined variables can (and should) be user in rules. The most widely used: Buildroot Yocto Package name <PKG>_NAME PN Package raw name <PKG>_RAWNAME BPN Package version <PKG>_VERSION PV Source code dir <PKG>_SRCDIR S Build dir <PKG>_BUILDDIR B Install files in (*) TARGET_DIR D Install images in (*) BINARIES_DIR DEPLOYDIR * The final dirs in Buildroot, temp dirs in Yocto. 34
  • 44. Adding patches Buildroot Yocto .patch file in package dir .patch file in recipe subdir (*) <PKG>_PATCH = <URL> SRC_URI += <URL> BR2_GLOBAL_PATCH_DIR tree Your layer * Plus SRC_URI += "file://foo.patch" (and FILESEXTRAPATHS_prepend = "<DIR>:") 35
  • 46. Invoking Buildroot Yocto make [all] bitbake <IMAGE> make busybox bitbake busybox make busybox-configure bitbake -c configure busybox make busybox-reconfigure bitbake -C configure busybox make clean bitbake -c clean world make busybox-dirclean bitbake -c clean busybox 36
  • 47. Tuning resource usage Buildroot Yocto BR2_JLEVEL=2 make PARALLEL_MAKE="-j 2" bitbake ... — BB_NUMBER_THREADS=2 bitbake ... Build options → Enable compiler cache — — SSTATE_DIR ?= " /.sstate-cache" 37
  • 48. Buildroot: out-of-tree builds • make O=foo foo_defconfig • make O=bar bar_defconfig • cd foo; make • Build in foo/* instead of output/* 38
  • 49. Buildroot: out-of-tree builds • make O=foo foo_defconfig • make O=bar bar_defconfig • cd foo; make • Build in foo/* instead of output/* • cd bar; make • Can run in parallel 38
  • 50. Yocto: multiple machines and images • bitbake core-image-minimal • bitbake my-image-huge • Recycles common artifacts 39
  • 51. Yocto: multiple machines and images • bitbake core-image-minimal • bitbake my-image-huge • Recycles common artifacts • MACHINE=another-board bitbake my-image-huge • Remember to use ?= to set MACHINE in your conf file 39
  • 52. Buildroot dependency tracking: stamp files • Dependency tracking is at the core of Make (program → .o → .c) • Does not fit completely the needs of a buildsystem • Internally Buildroot touches a stamp file after completing each step • An empty file • Tracks successful step completion, not the rules that originated it • If the rules change, Buildroot is unaware 40
  • 53. Buildroot dependency tracking: stamp files • You need to manually trigger a rebuild when: • You changed the configuation of the package or one of its dependencies • You’re developing the package and changed the rules (.mk, patches…) • How to rebuild • The safe option: make clean; make • If you know what you really need: make <PKG>-dirclean <PKG> • Or make <PKG>-reconfigure / make <PKG>-rebuild 41
  • 54. Yocto: recipe hash • Bitbake stores a hash for each task • Hash content: • All the recipe variables and task code (bitbake -e) • Content of all files stored in SRC_URI • Automatically detect recipe changes and rebuilds what’s needed • Result stores in the sstate cache for later reuse 42
  • 55. Yocto: recipe hash • Still want to force a task? • bitbake -f -c configure <PKG> • -f forces to run tasks even when not needed 43
  • 56. Where are my output files? 43
  • 57. Work directory layout <TOP> <--CWD <TOP> build <--CWD output tmp build work <TUPLE> busybox 1.27.2-r0 busybox-1.29.2 busybox-1.27.2 image package packages-split build 44
  • 58. Root filesystem generation <TOP> <--CWD <TOP> build <--CWD output tmp work <MACHINE TUPLE> core-image-minimal 1.0-r0 target rootfs bin, usr...bin, usr... 45
  • 59. Output directory layout <TOP> <--CWD <TOP> build <--CWD output tmp images deploy images <MACHINE> u.boot.* *Image <IMG>-<MACHINE>.<EXT> *.dtb rootfs.<EXT> *Image *.dtb u-boot.* sdcard.img 46
  • 61. What will it build? 46
  • 62. Buildroot: graph-depends • make graph-depends • Produces output/graphs/graph-depends.pdf ALL busybox host-dosfstools host-genimage host-mtools host-patchelf ifupdown-scripts initscripts linux skeleton toolchain uboot rootfs-ext2 rootfs-tar host-lzip host-skeleton host-libconfuse host-pkgconf host-bisonhost-flex host-kmod host-m4 host-gettext host-automakehost-libxml2 host-autoconf host-libtool skeleton-init-sysv skeleton-init-common toolchain-buildroot host-gcc-final uclibc host-gcc-initial linux-headers host-binutils host-mpc host-mpfr host-gmp host-dtc host-e2fsprogs rootfs-common host-util-linux host-zlib host-libzlib host-fakeroot host-makedevshost-acl host-attr 47
  • 63. Buildroot: graph-depends • Build a per-package graph: <PKG>-graph-depends • Set BR2_GRAPH_DEPS_OPTS in the environment to control the output • BR2_GRAPH_DEPS_OPTS="--exclude=host" make avahi-graph-depends • Produces output/graphs/avahi-graph-depends.pdf avahi dbus libdaemon expat 48
  • 64. Yocto: taskexp • Generating dot graphs not really usable • Task Explorer: bitbake -g -u taskexp world • Shows dependencies between tasks (not recipes) 49
  • 65. What does it do? What went wrong? 49
  • 66. Buildroot: default output $ make ... >>> host-e2fsprogs 1.44.2 Extracting xzcat /home/murray/src/e2fsprogs/e2fsprogs-1.44.2.tar.xz... >>> host-e2fsprogs 1.44.2 Patching >>> host-e2fsprogs 1.44.2 Configuring checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu ... • “>>>” marks the started tasks • The whole output of each step follows • Failure? Look at the last lines 50
  • 67. Buildroot: concise output $ ./utils/brmake ... 2018-10-06T16:15:58 >>> host-zlib Patching 2018-10-06T16:15:58 >>> host-zlib Configuring 2018-10-06T16:15:58 >>> host-zlib Building 2018-10-06T16:15:58 >>> host-zlib Installing to host directory 2018-10-06T16:15:58 >>> host-util-linux 2.32.1 Patching ... • Adds step start time • Verbose output saved in br.log 51
  • 68. Yocto: default output • The default output shows the current status, no logs • Hides completed tasks Currently 4 running tasks (119 of 2503) 4% |## | 0: glibc-initial-2.27-r0 do_fetch (pid 5216) 38% |############ | 4.09M/s 1: glibc-2.27-r0 do_fetch - 4s (pid 5261) 2: ncurses-native-6.0+20171125-r0 do_fetch (pid 6147) | <=> | 3: elfutils-native-0.170-r0 do_fetch (pid 7143) 11% |### | 2.49M/s 52
  • 69. Yocto: concise “log” output • To see the completed tasks: • bitbake ... | cat NOTE: Running task 119 of 2645 (.../binutils/binutils-cross_2.30.bb:do_unpack) NOTE: Running task 232 of 2645 (virtual:native:...lzo/lzo_2.10.bb:do_compile) NOTE: recipe binutils-cross-arm-2.30-r0: task do_unpack: Started NOTE: recipe binutils-cross-arm-2.30-r0: task do_prepare_recipe_sysroot: Started NOTE: recipe elfutils-native-0.170-r0: task do_prepare_recipe_sysroot: Started NOTE: recipe lzo-native-2.10-r0: task do_compile: Started NOTE: recipe elfutils-native-0.170-r0: task do_prepare_recipe_sysroot: Succeeded NOTE: Running task 247 of 2645 (virtual:native:.../elfutils_0.170.bb:do_configure) NOTE: recipe binutils-cross-arm-2.30-r0: task do_prepare_recipe_sysroot: Succeeded 53
  • 70. Yocto: inspect build logs • Failure? • For each task a log file is saved • in tmp/work/<TUPLE>/<RECIPE>/<VERSION>/temp/log.do_<TASK> • e.g. tmp/work/x86_64-linux/gmp-native/6.1.2-r0/temp/log.do_configure • Or re-run the failed task with verbose output to see its output on your terminal • bitbake -v -f -c configure gmp-native 54
  • 71. What is it thinking? 54
  • 72. Buildroot: printvars • make -s printvars • Print all variables • make -s VARS=BUSYBOX_% printvars • Only variables matching a pattern • make -s RAW_VARS=YES printvars • Print unexpanded values • make -qp • Print the whole Make database • Variables (before expansion) and the file where they were set • Rules (target + prerequisites + actions) 55
  • 73. Yocto: bitbake -e • bitbake -e • Show the global environment • Variables and the files where they were set • bitbake -e <RECIPE> • Show the per-recipe environment • Variables and the files where they were set • Tasks actions 56
  • 74. Customizing the root filesystem
  • 75. Buildroot: Kconfig • The same configuration system as the kernel, Busybox, U-Boot, Barebox… • make menuconfig, make xconfig • .config is your current configuration • make savedefconfig updates your defconfig with the new values 57
  • 76. Yocto: .bb files • Your “configuration” is in several .bb files. • A common layout: • Build options, toolchain, MACHINE: a conf file in your top layer (or build/conf/local.conf) • Target options, kernel and bootloader selection: in your layer conf/machine/<MACHINE>.bb • System configuration: various recipes, other places • Packages to put in rootfs: image recipe (see later) 58
  • 77. Buildroot: adding packages • make menuconfig → Packages • Search, add, remove, change packages • make clean (if you changed or remove packages) • make 59
  • 78. Yocto: adding packages • Find the package you need • bitbake-layers show-recipes • http://layers.openembedded.org/layerindex/branch/ master/recipes/ • Create your own image recipe • Image = list of packages to but in rootfs (a subset of all the packages) 60
  • 79. Yocto: adding packages • Create an image recipe (<MYLAYER>/recipes-*/images/*-image-*.bb) require recipes-core/images/core-image-minimal.bb DESCRIPTION = "My own root filesystem" LICENSE = "MIT" IMAGE_FSTYPES = "tar.gz" IMAGE_INSTALL += "htop packagegroup-debug" • Package groups (<MYLAYER>/recipes-*/packagegroups/packagegroup-*.bb) inherit packagegroup RDEPENDS_${PN} = "gdb strace" 61
  • 80. Typical root filesystem customizations • And embedded systems needs customizations • High-level choices: init system, /dev management, locales… • Creation of users, passwords, assorted files, … • And many more • Buildroot • make menuconfig → System configuration • Yocto • Add appropriate lines to your conf, board or image files • Search the Yocto reference manual https://www.yoctoproject.org/docs/current/ ref-manual/ref-manual.html • Grep the poky source code 62
  • 81. Some system settings, side-by-side Buildroot Yocto System hostname hostname_pn-base-files = "mybox" System banner DISTRO_NAME_pn-base-files = "Welcome", DISTRO_VERSION_pn-base-files = "" Init system VIRTUAL-RUNTIME_init_manager /dev management VIRTUAL-RUNTIME_dev_manager Root password IMAGE_FEATURES += "empty-root-password" Users tables inherit extrausers; EXTRA_USERS_PARAMS = "usermod -P 1876*18 root;" 63
  • 82. Other rootfs customizations • Buildroot: System configuration menu: • Root filesystem overlay directories • Post-build and post-image scripts • Yocto • ROOTFS_POSTPROCESS_COMMAND and IMAGE_POSTPROCESS_COMMAND 64
  • 84. Configuring Kconfig-based packages • Buildroot • Based on kconfig-package • Kconfig packages: at91bootstrap3, barebox, uboot, linux, busybox, linux-backports, swupdate, uclibc, xvisor • Yocto • Inherit the obscure cml1 class • Kconfig packages in the Poky layer: linux, busybox (not U-Boot) 65
  • 85. Configuring Kconfig-based packages Description Buildroot Yocto Enter menu make <PKG>-menuconfig bitbake -c menuconfig <RCP> Save defconfig make <PKG>-savedefconfig bitbake -c savedefconfig <RCP> Update defconfig make <PKG>-update-defconfig — Extract fragment — bitbake -c diffconfig <RCP> 66
  • 86. Yocto: (re)assigning variables • Assignments • F := "foo-${A}" — Immediate expansion • F = "foo-${A}" — Expansion on usage • Weak assignments: used for values the user is supposed to customize • Base layer .bb: VAR ??= "white" • Middle layer .bbappend: VAR ?= "black" • Top-level layer.bbappend: VAR = "green" • The recipe will use VAR = "green" • Append or prepend • VAR += "val", VAR =+ "val" (adds spaces) • VAR_append = "val", VAR_prepend = "val" (does not add spaces) • VAR_remove = "val" 67
  • 87. Buildroot: (re)assigning variables • It’s a Makefile, use the Make syntax • Assignments • F := "foo-$(VER)" — Immediate expansion • F = "foo-$(VER)" — Expansion on usage • Append or prepend • VAR = "$(VAR) extra", VAR = "extra $(VAR)" 68
  • 88. More string processing • Buildroot • Make has several functions for transforming text • Example: VAR = $(filter-out bug, foo bug bar) • Yocto • If Bitbake is not enough, use Python • PV_x = "${@'.'.join('${PV}'.split('.')[0:2] + ['x'])}" ”10.11.12” → ”10.11.x” 69
  • 89. Yocto: changing task code do_conf_append() { echo CONFIG_ACS >>${D}/.config } do_install_prepend() { mkdir -p ${D}${bindir} } • Append or prepend code • Final task code = concatenation of prepends + base + appends • Don’t mix Bash and Python 70
  • 90. Buildroot: changing task code define FOO_ENABLE_ACS echo CONFIG_ACS >>$(@D)/.config endef FOO_POST_CONFIGURE_HOOKS += FOO_ENABLE_ACS define FOO_CREATE_BIN_DIR mkdir -p $(TARGET_DIR)/bin endef FOO_PRE_INSTALL_HOOKS += FOO_CREATE_BIN_DIR • Append or prepend code • Final Make rule actions = concatenation of pre-hooks + base + post-hooks 71
  • 92. Thank you for your attention Questions? Luca Ceresoli luca@lucaceresoli.net http://lucaceresoli.net © Copyright 2018, Luca Ceresoli. Slides released under Creative Commons Attribution - Share Alike 3.0 License https://creativecommons.org/licenses/by-sa/3.0/ 72
  • 94. Working with local sources • Use sources from a local directory • Not managed by the build system • Useful during application development • Buildroot • <PKG>_OVERRIDE_SRCDIR=/my/src/tree make • Skips source, extract, patch • rsyncs from /my/src/tree before building • Yocto • inherit externalsrc • EXTERNALSRC = "/my/src/tree" • fetch, unpack, patch • Points S to /my/src/tree