Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Using OpenEmbedded
1. A brief overview of the
scope and issues
involved with building your own
GNU/Linux-based distributions.
Trevor Woerner
trevor@toganlabs.com
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
2. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
2 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Trevor Woerner
●
Senior Software Developer @
Togán Labs
●
Embedded Linux development
and consulting
●
Specialize in OpenEmbedded
●
Strong open-source focus
3. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
3 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Why?
4. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
4 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
why create your own distribution?
●
very difficult to answer for (casual) user
●
easier to answer when building products
●
tight control over installed software
●
tight control over versions of installed software
●
security
●
software updates
●
device lifetime, multiple devices
5. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
5 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Code Choices
6. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
6 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux
a
press power
button
bootloader kernel boot init system
display
manager /
login screen
window
manager
gui
display server
protocol
desktop
environment
text
START
7. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
7 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
in a GNU/Linux system,
only this is "Linux"
kernel boot
8. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
8 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
bootloader
●
grub
●
u-boot
●
lilo
●
syslinux
●
systemd-boot
●
gummiboot
●
barebox
●
shim
9. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
9 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
kernel boot
●
latest kernel.org
●
LTS
●
evil vendor kernel
●
benevolent distro kernel
●
with or without PREEMPT_RT
●
2.6 / 3.x / 4.x
●
xenomai
10. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
10 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
a
init system
●
sysvinit
●
systemd
●
upstart
●
busybox init
●
OpenRC
●
runit
11. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
11 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
display server
protocol
●
X11
●
wayland
●
directfb
●
mir
12. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
12 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
display
manager /
login screen
●
XDM
●
GDM
●
KDM
●
LXDM
●
CDM
●
xlogin
●
nodm
●
LightDM
13. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
13 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
desktop
environment
●
GNOME
●
KDE
●
LXDE
●
MATE
●
LXQt
●
Enlightenment
●
Cinnamon
●
Unity
●
Xfce
14. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
14 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
booting GNU/Linux - drilling down
window
manager
●
Xfwm
●
Openbox
●
KWin
●
i3
●
FVWM
●
TWM
●
compiz
●
Matchbox
●
Metacity
●
Sawfish
●
mwm
●
uwm
●
xmonad
●
ion
●
fluxbox
15. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
15 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
NOT booting GNU/Linux - drilling down
●
bash
●
csh
●
tcsh
●
zsh
●
sh
●
ash
●
ksh
●
mosh
●
dsh
Shells
●
gnome-terminal
●
xterm
●
konsole
●
rxvt
●
xfce4-terminal
Terminal
Emulators
16. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
16 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
NOT booting GNU/Linux - drilling down
●
bash
●
csh
●
tcsh
●
zsh
●
sh
●
ash
●
ksh
●
mosh
●
dsh
Shells
●
gnome-terminal
●
xterm
●
konsole
●
rxvt
●
xfce4-terminal
Terminal
Emulators
●
apache2
●
tomcat
●
jetty
●
lighttpd
●
Nginx
●
cherokee
●
fcgi
●
hiawatha
●
monkey
●
nostromo
Web
Servers
●
chromium
●
firefox
●
links
●
epiphany
●
opic
●
midori
●
konqueror
●
qtwebbrowser
●
rekonq
Web
Browsers
17. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
17 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
NOT booting GNU/Linux - drilling down
●
bash
●
csh
●
tcsh
●
zsh
●
sh
●
ash
●
ksh
●
mosh
●
dsh
Shells
●
gnome-terminal
●
xterm
●
konsole
●
rxvt
●
xfce4-terminal
Terminal
Emulators
●
apache2
●
tomcat
●
jetty
●
lighttpd
●
Nginx
●
cherokee
●
fcgi
●
hiawatha
●
monkey
●
nostromo
Web
Servers
●
OpenSSH
●
dropbear
SSH
Servers●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
chromium
●
firefox
●
links
●
epiphany
●
opic
●
midori
●
konqueror
●
qtwebbrowser
●
rekonq
Web
Browsers
●
glibc
●
uclibc
●
musl
C
Libraries
●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities ●
gcc
●
llvm
C
Compilers
18. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
18 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
NOT booting GNU/Linux - drilling down
●
bash
●
csh
●
tcsh
●
zsh
●
sh
●
ash
●
ksh
●
mosh
●
dsh
Shells
●
gnome-terminal
●
xterm
●
konsole
●
rxvt
●
xfce4-terminal
Terminal
Emulators
●
apache2
●
tomcat
●
jetty
●
lighttpd
●
Nginx
●
cherokee
●
fcgi
●
hiawatha
●
monkey
●
nostromo
Web
Servers
●
OpenSSH
●
dropbear
SSH
Servers●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
db
●
gdbm
●
sqlite
●
hiera
●
metakit
●
mysql
●
postgresql
Databases
●
chromium
●
firefox
●
links
●
epiphany
●
opic
●
midori
●
konqueror
●
qtwebbrowser
●
rekonq
Web
Browsers
●
glibc
●
uclibc
●
musl
C
Libraries
●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
java
●
python
●
go
●
rust
●
nodejs
●
ruby
●
perl
●
mono
●
smalltalk
●
erlang
●
ada
Language
Support
●
gcc
●
llvm
C
Compilers
20. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
20 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
NOT booting GNU/Linux - drilling down
●
bash
●
csh
●
tcsh
●
zsh
●
sh
●
ash
●
ksh
●
mosh
●
dsh
Shells
●
gnome-terminal
●
xterm
●
konsole
●
rxvt
●
xfce4-terminal
Terminal
Emulators
●
apache2
●
tomcat
●
jetty
●
lighttpd
●
Nginx
●
cherokee
●
fcgi
●
hiawatha
●
monkey
●
nostromo
Web
Servers
●
OpenSSH
●
dropbear
SSH
Servers●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
db
●
gdbm
●
sqlite
●
hiera
●
metakit
●
mysql
●
postgresql
Databases
●
chromium
●
firefox
●
links
●
epiphany
●
opic
●
midori
●
konqueror
●
qtwebbrowser
●
rekonq
Web
Browsers
●
glibc
●
uclibc
●
musl
C
Libraries
●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
java
●
python
●
go
●
rust
●
nodejs
●
ruby
●
perl
●
mono
●
smalltalk
●
erlang
●
ada
Language
Support
●
gcc
●
llvm
C
Compilers
●
wolfssl
●
tpm/tpm2
●
swupd/swupdate
●
selinux
●
optee
●
ro-rootfs
●
pentesting/kali
Security ●
lxd/lxc
●
docker
●
openstack
●
criu
●
kubernetes
●
kvm
●
oci
●
xen
Virtualization
VER
SIO
N
S
21. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
21 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
NOT booting GNU/Linux - drilling down
●
bash
●
csh
●
tcsh
●
zsh
●
sh
●
ash
●
ksh
●
mosh
●
dsh
Shells
●
gnome-terminal
●
xterm
●
konsole
●
rxvt
●
xfce4-terminal
Terminal
Emulators
●
apache2
●
tomcat
●
jetty
●
lighttpd
●
Nginx
●
cherokee
●
fcgi
●
hiawatha
●
monkey
●
nostromo
Web
Servers
●
OpenSSH
●
dropbear
SSH
Servers●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
db
●
gdbm
●
sqlite
●
hiera
●
metakit
●
mysql
●
postgresql
Databases
●
chromium
●
firefox
●
links
●
epiphany
●
opic
●
midori
●
konqueror
●
qtwebbrowser
●
rekonq
Web
Browsers
●
glibc
●
uclibc
●
musl
C
Libraries
●
coreutils
●
busybox
●
toybox
Basic
Cmdline
Utilities
●
java
●
python
●
go
●
rust
●
nodejs
●
ruby
●
perl
●
mono
●
smalltalk
●
erlang
●
ada
Language
Support
●
gcc
●
llvm
C
Compilers
●
wolfssl
●
tpm/tpm2
●
swupd/swupdate
●
selinux
●
optee
●
ro-rootfs
●
pentesting/kali
Security ●
lxd/lxc
●
docker
●
openstack
●
criu
●
kubernetes
●
kvm
●
oci
●
xen
Virtualization
VER
SIO
N
S
DEPENDENCIES
22. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
22 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
why "re-invent the wheel" and create alternates of
existing, working projects?
●
code forks due to disagreement in {techincal | legal |
community | leadership | ...} direction
●
real or perceived legal issues
●
re-design in order to
●
add more features
●
support more platforms
●
fundamentally change how something works
(algorithm)
23. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
23 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
why "re-invent the wheel" and create alternates of
existing, working projects?
●
to promote "healthy" competition
●
unaware of existing projects
●
original project is abandoned
●
to "start fresh"
●
for the learning experience
24. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
24 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
a GNU/Linux system is not one single, monolithic blob
created by one company/organization
●
individual people/groups, working mostly
autonomously
●
rarely a top-level, rigid, overall, pre-developed spec
●
independent release schedules
●
multiple options at every step
●
choosing a cohesive set → DISTRIBUTION
●
one doesn’t slap together a cohesive, working set by
accident
25. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
25 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
issues
●
there is no “one correct way” to write (open-source)
software
●
language
●
repository system
●
location
●
licensing
●
(still) not enough developers consider cross-
compilation
26. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
26 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
solution
●
use an embedded Linux build system
●
PLEASE don’t “roll your own”
27. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
27 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Running Code
28. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
28 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
●
processors are the heart of any device
●
all processor families "speak" their own "language"
(sometimes sub-groups within a family have their own
"dialect")
●
a programmer's intentions, eventually, has to be
expressed in the processor's "language"
●
either by compiling/assembling/linking code
●
or by running the code through an interpreter
●
whether we're talking about compiled code, or
interpreted, at some point compiling needs to take
place (compiling of code, compiling of interpreter)
29. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
29 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
how to compile code
●
fetch code
●
unpack
●
patch
●
configure
●
build/compile
●
stage
●
package
30. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
30 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
fetch
●
not always obvious from where to get code
●
interact with a repository (svn, cvs, git, hg, perforce,
clearcase, rcs/sccs, darcs, monotone, GNU bazaar,
MS vss...) or tarball releases (e.g. ftp)
●
interact with a code hosting site (github,
sourceforge, bitbucket, gitlab, launchpad,
cloudforge...)
●
branches, tags
●
verify signature/checksum(s)
31. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
31 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
unpack
●
compression
●
gzip, bzip2, xz, z, lzo, lzma
●
archive
●
tar, cpio, shar
●
compression + archive
●
7z, zip, arc, apk, tar.{gz|xz|bzip2|...}
32. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
32 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
patch
●
when you do something (even slightly) different than
what the people who wrote the code are doing,
patches are often needed
●
different compiler
●
different/newer/older host
●
different C library
●
different versions of dependencies
●
sometimes upstream doesn't accept your patch
●
where to store/maintain these patches?
33. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
33 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
configure
●
enable/disable features
●
build systems
●
make
●
makefile generators
●
autotools
●
cmake
●
pymake
●
"make" replacements
●
ant
●
maven
●
waf
●
ninja
●
gyp/gn
●
meson
34. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
34 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
build/compile
●
cross-compiling
●
selecting, patching, configuring a cross-compiler
(and C lib) is non-trivial
●
using the cross-compilier is non-trivial (avoiding
host contamination)
35. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
35 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
stage
●
preparing artifacts for the target
●
packing
●
signing
●
arranging
●
updating/removing
●
only install relevant parts (remove docs, man pages,
include files... unless user wants them explicitly)
36. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
36 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
package
●
ipk
●
deb
●
rpm
37. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
37 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Target
Device
38. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
38 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
each device has its own quirks
●
RPi
●
fat + ext partitions
●
config.txt in fat
●
Rockchip
●
multiple partitions, individual chunks per partition
●
all chunks need to run through vendor tool
●
AllWinner
●
special "fex" files (i.e. pre-dt) + script.bin
●
DragonBoard 410c
●
fastboot tools to load eMMC
●
C.H.I.P.
●
special "UBI" image
●
board needs to be in "FEL" mode
●
etc...
39. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
39 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Putting It
Together
40. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
40 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
creating a distro
●
choosing amongst 1000's x 1000's of packages,
making sure there's one of each of the required
packages, dependencies, versions, ...
●
preparing the right cross-development tools
●
building (fetching, unpacking, patching, configuring,
cross-compiling, staging, packaging) the software
●
getting that software onto/into the target device in
the proper format
41. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
41 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
OpenEmbedded
42. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
42 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
●
targeting multiple devices!
OpenEmbedded
43. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
43 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
OpenEmbedded
●
provides "recipes" for 1000's of packages ~>
2000ish in base layers alone
●
prepares the cross-development tools
●
builds (fetches, unpacks, patches, configures, cross-
compiles, stages, package) the software with a very
sophisticated scheduler with correct dependencies
●
creates an image for the target device in the proper
format
●
targets multiple platforms/devices with small
configuration changes (often a one line change)
44. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
44 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
OpenEmbedded+
●
has an optional graphical front-end (toaster)
●
optionally integrates into Eclipse
●
can generate image-specific SDK and eSDK
●
the (e)SDK can be used on Linux, Windows, or
MacOS hosts (CROPS)
●
supports many hardware targets (including qemu)
across many architectures (x86, arm, ppc, mips,
riscv) and variants (32bit, 64bit) ~> 600ish
45. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
45 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
MinnowBoard/Turbot
●
Intel Atom x86_64
●
Intel Graphics
●
1GB - 2GB DDR3
●
uSD, GbE, USB2/3
●
turbot dual/quad dual-eth
●
meta-intel
$99
46. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
46 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
BeagleBoard/Bone
●
TI OMAP3xxx/Sitara AM3xxx
●
Cortex-A8, Cortex-A15
●
PowerVR
●
256MB - 512MB DDR2
●
SD/uSD, 10/100, USB2, PRU
●
BeagleBoard, BeagleBoard-xM,
BeagleBone, BeagleBone
Black, BeagleBoard x15
●
meta-ti
$55
47. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
47 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
DragonBoard 410c
●
Qualcomm Snapdragon 410
●
Cortex-A53
●
Adreno 306 → Freedreno
●
2GB DDR3
●
uSD, 8GB eMMC, USB2, WiFi
2.4GHz a/b/g/n, bt 4.1
●
meta-qcom
$75
48. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
48 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
C.H.I.P. (i.e. the $9 computer)
●
AllWinner R8
●
Cortex-A8
●
Mali-400
●
512MB DDR3
●
4GB eMMC, USB2, WiFi
2.4GHz a/b/g/n, bt 4.0
●
meta-chip
$9
49. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
49 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Creator Ci20
●
MIPS Ingenic JZ4780
●
PowerVR
●
1GB DDR3
●
8GB eMMC, SD, 10/100, USB2,
WiFi 2.4GHz b/g/n, bt 4.0
●
meta-jz-mips
$72
50. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
50 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Odroid C1/C2
●
Amlogic S805/S905
●
ARM Cortex-A5, Cortex-A53
●
Mali-450
●
1GB - 2GB DDR3
●
opt eMMC, uSD, GbE, USB2
●
meta-odroid
$40
51. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
51 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Odroid XU3/XU4
●
Samsung Exynos 5 Octa
●
ARM Cortex-A7 + A15
●
Mali-T628
●
2GB DDR3
●
opt eMMC, uSD, 10/100/GbE,
USB2/3
●
meta-odroid
$74
52. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
52 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Zybo-Zynq7
●
Xilinx Zynq 7Z007S
●
ARM Cortex-A9
●
512MB DDR3
●
PMOD, uSD, USB2
●
meta-xilinx
$189
53. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
53 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Pine64
●
AllWinner A64
●
ARM Cortex-A53
●
Mali-400
●
512MB DDR3
●
uSD, 10/100, USB2
●
meta-pine64
$189
54. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
54 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Firefly-RK3288
●
Rockchip RK3288
●
ARM Cortex-A17
●
Mali-T760
●
2GB - 4GB DDR3
●
16GB eMMC, uSD, GbE, WiFi
a/b/g/n/ac, bt 4.0+ble, USB2
●
meta-rockchip
$129
55. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
55 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Wandboard
●
Freescale iMX6
●
ARM Cortex-A9
●
Vivante → Etnaviv
●
1GB DDR3
●
uSD, GbE, WiFi n, USB2
●
solo, dual, quad
●
meta-freescale-3rdparty
$69
56. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
56 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Raspberry Pi
●
Broadcom BCM2835 BCM2836
BCM2837
●
ARM11, Cortex-A7, Cortex-A53
●
Broadcom VC4
●
512MB - 1GB DDR2
●
uSD, 10/100, USB2
●
Rpi A/B, Rpi2, Rpi0, Rpi3,
Rpi3B+
●
meta-raspberrypi
$35
57. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
57 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Banana Pi
●
AllWinner A20
●
Cortex-A7
●
Mali-400
●
1GB DDR3
●
SD, GbE, USB2
●
meta-sunxi
$32
58. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
58 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Orange Pi
●
AllWinner A20/H2/H3
●
Cortex-A7
●
Mali-400
●
1GB - 2GB DDR3
●
uSD, GbE, USB2
●
meta-sunxi
$25
59. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
59 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
OpenEmbedded++
●
runs on most GNU/Linux host distributions (debian,
ubuntu, fedora, centOS, openSUSE)
●
is mostly host-independent (builds it own set of
many native tools)
●
extensive test framework (build tests, package unit-
tests, on-target tests, image/boot tests)
●
license/legal audit or constraint
●
speeds up subsequent builds with sophisticated
sstate cache
60. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
60 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
How Does
It Work?
61. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
61 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
recipes
●
a file with the necessary data to process a package
classes
●
a grouping of similar functionality
layers
●
a set of related recipes, classes, data for a specific
purpose (BSP, software, distro)
bitbake
●
the tool which runs the whole build
configuration files
●
e.g. conf/local.conf
62. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
62 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
sample recipe (openembedded-core/meta/recipes-graphics/mesa/mesa -- abridged)
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
63. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
63 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
preamble
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
64. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
64 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
license
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
65. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
65 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
alternates of same purpose
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
66. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
66 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
adding classes of known functionality
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
67. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
67 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
configuration options
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
68. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
68 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
dependencies (build and native)
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
69. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
69 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
fetch: location, patch, signature verification
SUMMARY = "A free implementation of the OpenGL API"
DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different environments
ranging from software emulation to complete hardware acceleration for modern GPUs.
Mesa is used as part of the overall Direct Rendering Infrastructure and X.org
environment."
HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "X11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
DEPENDS = "expat makedepend-native zlib"
PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
inherit autotools pkgconfig python3native gettext distro_features_check
PACKAGECONFIG ??= "x11 dri3"
PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto presentproto libxshmfence"
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz
file://disable-asm-on-non-gcc.patch"
SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
70. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
70 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
layers (conf/bblayers.conf)
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "7"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= "
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-raspberrypi
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/openembedded-core/meta
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-openembedded/meta-oe
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-openembedded/meta-gnome
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-openembedded/meta-python
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-openembedded/meta-networking
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-openembedded/meta-multimedia
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-qt5
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-qt5-extra
/opt/oe/configs/z/build-master/rpi3-64-vc4/layers/meta-browser
"
72. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
72 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Case Study
73. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
73 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
customers
hardware
manufacturers
RDK
74. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
74 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
RDK set-top-box
●
purposefully multi-vendor, multi-architecture
●
but expects a base, functioning system
●
needs to add its own software on top
●
needs to tightly control the base system
●
packages
●
versions
●
functionality (e.g. init system, graphics)
75. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
75 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
OpenEmbedded solution
●
RDK is its own distro → RDK (layer)
●
defines packages, behaviour
●
vendors create hardware and provide BSP layers
●
RDK builds images for each device using distro
layer, BSP layer, as well as others
●
RDK generates SDKs for the developers
●
RDK maintains a packagefeed for updates
●
this is not a "home grown" solution, embedded
developers are already familiar with the tools
76. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
76 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Caveats
77. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
77 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
●
not all layers work well together
●
OpenEmbedded doesn't catch all mistakes and mis-
matches
●
code is constantly changing, and getting all these
independent projects to work as a cohesive whole
isn't always easy (moving target)
●
layer quality, layer duplications
●
needs a really big build machine
●
works better with a really good connection to the
Internet
●
... and more
78. SCaLE 17x
March 10, 2019
trevor@toganlabs.com
78 of 78
Using OpenEmbeddedAn Introduction To Building Your Own Distributions
Thank you!