yocto project - upb · yocto project general philosophy •support for the major architectures...
TRANSCRIPT
![Page 1: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/1.jpg)
Lecture 1
1Yocto Project11 octomber 2016
![Page 2: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/2.jpg)
Outline
Introduction
Embedded systems
GNU/Linux introduction
Toolchains
Build systems
Yocto Project
11.10.2016 2
![Page 3: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/3.jpg)
On this class
MPSIT
Yocto Project
embedded linux
lecture: Tuesday 4pm-6pm, room PR103
labs: Tuesday 6pm-8pm, room PR606
http://ocw.cs.pub.ro/courses/mpsit
311.10.2016
![Page 4: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/4.jpg)
The team
Alexandru Radovici, Razvan Rughinis: support
Alexandru Vaduva: labs
Alexandru Vaduva: lectures
411.10.2016
![Page 5: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/5.jpg)
Class keywords
Yocto Project
Embedded Linux
bootloader
Linux kernel
toolchain
Buildroot
Openembedded
open source
5
u-boot
gcc
glibc
binutils
hardware-agnostic
target machine
host machine
BSP
11.10.2016
![Page 6: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/6.jpg)
Bibliography
Embedded Linux Development with Yocto Project, Otavio Salvador, Daiane Angolini, 2014
Embedded Linux Projects Using Yocto Project Cookbook, Alex González, 2015
Learning Embedded Linux Using the Yocto Project, Alexandru Vaduva, 2015
Using Yocto Project with BeagleBone Black, H M Irfan Sadiq, 2015
Yocto for Raspberry Pi, Pierre-Jean Texier, Petter Mabäcker, 2016
611.10.2016
![Page 7: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/7.jpg)
Grading
2 points – lecture & lab involvement
2 points – tests during lectures
5 points – assignment
3 points – final exam
711.10.2016
![Page 8: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/8.jpg)
Tests during Lectures
at the beginning of lectures from the previous lectures
tests will be announced before
make sure you check the News section
10 minutes, short questions
811.10.2016
![Page 9: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/9.jpg)
Final exam
• first part: multiple answer questions – 20 minutes
• second part: paper test – 30 minutes
• covers all lectures
• passing grade is not mandatory
911.10.2016
![Page 10: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/10.jpg)
Assignment
• Need to be agreed upon
• Proposed projects:
– Testing framework for a Yocto Project Linux distribution
– Haptic feedback framework
– House automation graphical interface
– House automation web interface
– Optimize boot time & size for a Yocto Project Linux distribution
– Security for a Yocto Project Linux distribution
– Exploit and enhance the security holes of a Yocto Project Linux distribution
1011.10.2016
![Page 11: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/11.jpg)
Open-source involvement
• Educational, practice
• Linux kernel patches
• Yocto Project patches
• Other open source activities
• may be equivalent with lecture & lab activity and test points
1111.10.2016
![Page 12: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/12.jpg)
Outline
Introduction
Embedded systems
GNU/Linux introduction
Toolchains
Build systems
Yocto Project
1211.10.2016
![Page 13: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/13.jpg)
Embedded systems
1311.10.2016
![Page 14: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/14.jpg)
General description
Hardware dependent components
Bootloader
Kernel
Toolchain
Hardware independent components
Busybox
Userspace applications
1411.10.2016
![Page 15: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/15.jpg)
Outline
Introduction
Embedded systems
GNU/Linux introduction
Toolchains
Build systems
Yocto Project
1511.10.2016
![Page 16: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/16.jpg)
Linux architecture
1611.10.2016
![Page 17: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/17.jpg)
Main components
• Ubuntu 14.04
• Git (sudo apt-get install git-core)
• U-boot (http://git.denx.de/u-boot.git)
• Linux kernel (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
• C library (http://sourceware.org/git/glibc.git)
• Poky (http://git.yoctoproject.org/git/poky)
1711.10.2016
![Page 18: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/18.jpg)
U-boot
• Initialize: Bootstraps CPU, serial console, boot string
• Hardware detection and initialization
• Load the kernel image
• Load the hypervisor
• Support for:
– Different architectures, CPU, boards and devices
– Different file formats
– Secure boot and trusted software
1811.10.2016
![Page 19: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/19.jpg)
Multi stage bootloaders
• Usually involve the use of vendor provided low level components
• Incremental initialization of resources
• Every stage is done in a different context
1911.10.2016
![Page 20: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/20.jpg)
Bootloader sequence
2011.10.2016
![Page 21: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/21.jpg)
Embedded boot case
2111.10.2016
![Page 22: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/22.jpg)
Linux kernel
• The core of the OS
• Modules and sub-systems that provide the OS functions
• Monolithic type of kernel
• What else do we know about it?
2211.10.2016
![Page 23: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/23.jpg)
Linux kernel role
2311.10.2016
![Page 24: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/24.jpg)
Linux kernel architecture
2411.10.2016
![Page 25: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/25.jpg)
Linux kernel map
25
![Page 26: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/26.jpg)
Outline
Introduction
Embedded systems
GNU/Linux introduction
Toolchains
Build systems
Yocto Project
2611.10.2016
![Page 27: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/27.jpg)
Toolchain
• The usual development tool on a GNU/Linux distribution
• On embedded we work with cross-toolchains
• Target is slower and more restrictive then the host
• Is defined by a couple of components:
– GCC compiler
– GDB debugger (optional)
– C/C++ libraries
– Binutils
– Kernel headers
10.10.2011 27
![Page 28: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/28.jpg)
Toolchain build procedures
2811.10.2016
![Page 29: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/29.jpg)
glibc
• C library from the GNU project
• Used by Yocto Project
• Designed for performance, standards compliance and portability
• Actively maintained
• Found on all GNU/Linux host systems
2911.10.2016
![Page 30: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/30.jpg)
Building a toolchain
• Choosing the C library
• Choosing the configuration of the toolchain
• Choosing the version of different toolchain
• Which ABI should be used (most of them are incompatible)
• Should the toolchain support software floating point?
• Does the hardware support floating point operation?
• Should the toolchain support IPv6 or other specific features?
3011.10.2016
![Page 31: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/31.jpg)
Outline
Introduction
Embedded systems
GNU/Linux introduction
Toolchains
Build systems
Yocto Project
3111.10.2016
![Page 32: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/32.jpg)
Build systems
• Buildroot
• OpenEmbedded
• Yocto Project
• Lots of proprietary ones
3211.10.2016
![Page 33: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/33.jpg)
Common aspects
• Free software
• Embedded Linux build systems
• Build from scratch
• Use cross-compilation
• Actively developed and maintained
• Widely used in industry
• Very well documented
3311.10.2016
![Page 34: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/34.jpg)
Buildroot general philosophy
• Focus on simplicity
• Special use cases handled via extension scripts rather then Buildroot itself
• Re-use of existing technology
• Minimalistic by default
• Open community, no vendor or corporate managemenr
3411.10.2016
![Page 35: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/35.jpg)
Buildroot output
• Main product is a root filesystem image
– But also: bootloader, kernel image, toolchain etc.
• Main formats supported: ext2/3/4, ubifs, iso9660 etc.
• No binary packages, no package management system
– Belief that partial updates are harmful
– Updates are not possible via packages
– Updates require a full system update
3511.10.2016
![Page 36: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/36.jpg)
OpenEmbedded history
• Yocto Project and OpenEmbedded share the same build engine, called Bitbake
• Bitbake is inspired by Gentoo Portage build tool
• Evolved from Buildroot and it exploits its weaknesses
• Started in 2003
• Independent community driven project
3611.10.2016
![Page 37: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/37.jpg)
Outline
Introduction
Embedded systems
GNU/Linux introduction
Toolchains
Build systems
Yocto Project
3711.10.2016
![Page 38: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/38.jpg)
Yocto Project general philosophy
• Support for the major architectures
– Add support for a few machines besides qemu ones
• Only provides core recipes, uses layers to get support for more packages and machines
• Custom modification stay in separate layer
• Build system as flexible as possible
• Open community governed by the Yocto Project Advisory Board
3811.10.2016
![Page 39: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/39.jpg)
Yocto Project output
• Builds distribution, the main output being a package feed
– The package management system is optional on the target
– It is possible to install and update only part of the system
• Generates not only a root filesystem image but a full OS distribution. Supports many more filesystems extensions
• With the help of images classes or wic it can create disk images
• Able to generate and SDK for further application development and other purposes
3911.10.2016
![Page 40: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/40.jpg)
Yocto Project Administration
4011.10.2016
![Page 41: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/41.jpg)
Yocto Project support
4111.10.2016
![Page 42: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/42.jpg)
Yocto Project keywords
Append files
Bitbake
Build directory
Classes
Configuration file
Cross development toolchain
Image
Layer42
Metadata
Oe-core
Package
Poky
Recipe
Source directory
Tasks
Upstream
Hob11.10.2016
![Page 43: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/43.jpg)
Poky
• The reference distribution for the Yocto Project
• Includes the Bitbake build system and OpenEmbedded core metadata
• Used to bootstrap your own custom Linux distribution
• After downloading a number of recipes and configuration files are visible for Bitbake to process
• Similar to OpenEmbedded & Buildroot
4311.10.2016
![Page 44: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/44.jpg)
Yocto Project arhitecture
4411.10.2016
![Page 45: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/45.jpg)
Available recipes
• u-boot – recipes-bsp: instructions necessary to build the u-boot package
• Linux kernel – recipes-kernel: instructions necessary to build the Linux kernel package
• gcc, binutils, glibc – recipes-devtools, recipes-core: instructions necessary to build the toolchain specific packages
• core-image-minimal: reference build image
4511.10.2016
![Page 46: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/46.jpg)
Available configuration
• Machine: target specific configuration
• Distro: distribution specific configuration
• Layer.conf: layer specific configuration
• Local.conf: build directory specific configuration
4611.10.2016
![Page 47: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/47.jpg)
Poky task execution
4711.10.2016
![Page 48: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/48.jpg)
Yocto Project development
4811.10.2016
![Page 49: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/49.jpg)
Yocto Project development details
4911.10.2016
![Page 50: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/50.jpg)
Useful links
• https://www.yoctoproject.org/sites/yoctoproject.org/files/ypdd_2012_barcelona_intro_hands_on_lab_1.pdf
• http://software.intel.com/sites/default/files/m/2/6/8/b/3/42866-08_Yocto_overview.pdf
• http://www.yoctoproject.org/docs/1.3/dev-manual/dev-manual.html
• http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html
• http://layers.openembedded.org/layerindex
• http://www.slideshare.net/alexgonzalezgarcia/introduction-to-yocto
• https://wiki.yoctoproject.org/wiki/Contribution_Guidelines
• http://events.linuxfoundation.org/sites/events/files/slides/belloni-petazzoni-buildroot-oe_0.pdf
10.10.2011 50
![Page 51: Yocto Project - UPB · Yocto Project general philosophy •Support for the major architectures –Add support for a few machines besides qemu ones •Only provides core recipes, uses](https://reader034.vdocuments.mx/reader034/viewer/2022050718/5e17ba50174caa459e1ade7b/html5/thumbnails/51.jpg)
The End
?10.10.2011 51