I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration...
Transcript of I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration...
![Page 1: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/1.jpg)
I ❤ the Yocto Project
foss-north // Gothenburg 2018
![Page 2: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/2.jpg)
Introduction
• Gordan Markuš
• Embedded Linux, Luxoft, PELUX, AUTOSAR Adaptive
![Page 3: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/3.jpg)
Questions for the crowd
• How many attendes have built their own Embedded Linux image?
• How many attendes have used the Yocto Project?
![Page 4: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/4.jpg)
$ systemctl start yocto-presentation
![Page 5: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/5.jpg)
Embedded Linux Build Systems
• Goals• Creating custom Embedded Linux images
• Cross-compiling applications
• Packaging applications
• Create integration points for custom software
• Testing output binaries
• Checking ecosystem compatibilty
![Page 6: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/6.jpg)
Embedded Linux Build Systems
• Buildroot
• OpenWRT
• PTXdist
• Yocto Project / OpenEmbedded
• …
![Page 7: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/7.jpg)
My Embedded Linux Path
Ångström Buildroot PTXdistYocto
Project
![Page 8: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/8.jpg)
What is the Yocto Project?
„The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture.”
![Page 9: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/9.jpg)
Yocto Project
• Core building blocks• OpenEmbedded-Core
• BitBake
• Poky
![Page 10: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/10.jpg)
OpenEmbedded-Core
• Evolved from OpenEmbedded in collaboration with Yocto
• Compilation of components shared between OE based systems• Layers
• Recipes
• Classes
![Page 11: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/11.jpg)
Yocto Recipe
• Metadata file
• Describes the component dependencies, build, deploy steps, etc.
• Specific syntax
![Page 12: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/12.jpg)
Component information
Source information
Build and deployinstructions
![Page 13: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/13.jpg)
OpenEmbedded-Core
• Example recipes• ALSA
• Busybox
• cmake
• autoconf
![Page 14: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/14.jpg)
Yocto Layer
• Collection of recipes that have a common purpose
• Including a layer gives you the possibility to use its components
• meta- prefix
![Page 15: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/15.jpg)
Yocto Layer
• Example layers• meta-qt5
• meta-networking
• meta-intel
• meta-project-foo
![Page 16: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/16.jpg)
BitBake
• Build engine
• Parses and interprets the metadata files
• Task scheduler
![Page 17: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/17.jpg)
BitBake
Image – list ofpackages
ConfigurationOrderedtasklist
![Page 18: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/18.jpg)
Poky
• Yocto reference implementation
• Collection of tooling and configuration used to create a new distro
![Page 19: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/19.jpg)
![Page 20: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/20.jpg)
OK, great. But what are the cool parts?
![Page 21: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/21.jpg)
Layered Approach
• Logical separation and aggregation of software components
• Hardware agnostic development
• Maintainability
• Reusability
![Page 22: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/22.jpg)
Layered Approach
Project layer(meta-project-foo)
Commercial layer(meta-product-bar)
UI layer(meta-qt5)
Hardware layer(meta-intel)
Yocto layer(meta-yocto)
OpenEmbedded layer(oe-core)
Highest priority
Lowest priority
![Page 23: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/23.jpg)
Development and Debugging
• Production image vs development/debug image
• Features grouped in IMAGE_FEATURES
![Page 24: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/24.jpg)
Development and Debugging
![Page 25: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/25.jpg)
Development and Debugging
• Including dbg packages to the build – NOT FEASIBLE in the long run
• Creating a remote filesystem with debug symbols
# conf/local.conf
IMAGE_GEN_DEBUGFS = "1"
IMAGE_FSTYPES_DEBUGFS = "tar.bz2"
![Page 26: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/26.jpg)
Development and Debugging
• Connect host GDB to the GDB server on the target
• Point to remote debugfs to find the debug symbols
• Profit
![Page 27: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/27.jpg)
Testing
• Test image concept
• Automated runtime testing
• Virtualized or real hardware target
# conf/local.conf
TEST_IMAGE = "1"
![Page 28: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/28.jpg)
Testing
• Set of predefined unit tests• ping, ssh, dmesg, syslog, etc.
• Easy to add custom tests
# conf/local.conf
TEST_SUITES_append = "ping ssh auto"
![Page 29: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/29.jpg)
Testing
• Test results are available in the BitBake console
• Easy integration with the continous integration system
![Page 30: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/30.jpg)
License Compliance
• How to maintain compliance with various open source licenses during the product’s lifecycle?
![Page 31: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/31.jpg)
License Compliance
• Recipe variables• LICENSE
• LIC_FILES_CHKSUM
• What happens if theLICENSE file changesbetween revisions?
![Page 32: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/32.jpg)
License Compliance
• QtWebEngine license
![Page 33: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/33.jpg)
License Compliance
• Bill of materials• Source code
• License text
• Modifications
![Page 34: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/34.jpg)
License Compliance
• Blacklisting licenses using the INCOMPATIBLE_LICENSE variable
• Manually remove dependencies on or provide alternatives to components that are required
![Page 35: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/35.jpg)
License Compliance
• GPLv3 software is still a „big no-no!” in certain industries
• The goal is to prevent user modification on an embedded device
# conf/local.conf
INCOMPATIBLE_LICENSE = „ \GPL-3.0 \LGPL-3.0 \AGPL-3.0 \
"
![Page 36: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/36.jpg)
License Compliance
• Exclusion using the meta-gplv2 layer
„This layer contains a set of recipes corresponding to old, obsolete versions of software that are GPLv2 licensed where the upstreamshave moved to GPLv3 licenses. These were part of OE-Core until it was realised they are a ticking timebomb with regard to security updates and general maintenance.”
![Page 37: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/37.jpg)
To summarize
• Yocto is fun
• It has awesome features to ease your development
• It is hard to learn but it is totally worth it
• Share your experience with a technology you like
![Page 38: I the Yocto Project - foss-north · „The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems for embedded products](https://reader030.fdocuments.us/reader030/viewer/2022041109/5f0d15367e708231d4389803/html5/thumbnails/38.jpg)
$ systemctl stop yocto-presentation