Leveraging the Yocto Project to debug an embedded Linux system
Yocto - Embedded Linux Distribution Maker
-
Upload
sherif-mousa -
Category
Software
-
view
606 -
download
5
Transcript of Yocto - Embedded Linux Distribution Maker
![Page 1: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/1.jpg)
Embedded Linux @ Information Technology Institute 1
Embedded Linux
Yocto
Information Technology Institute
Sherif Mousa
![Page 2: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/2.jpg)
Embedded Linux @ Information Technology Institute 2
Agenda
● What is Yocto?● Why Yocto?● Yocto Project Overview● Yocto Key Concept (recipe)● Yocto Workflow● Yocto Member Organizations● Working with Yocto
![Page 3: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/3.jpg)
Embedded Linux @ Information Technology Institute 3
What is Yocto?
It's not an embedded Linux distribution -
It creates a custom one for you.● www.yoctoproject.org● The Yocto Project is an open-source collaboration project. It
provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of hardware architecture.
● Yocto Project uses a build system based on the OpenEmbedded (OE) project, which uses the BitBake tool, to construct complete Linux images. The BitBake and OE components are combined together to form Poky, a reference build system.
![Page 4: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/4.jpg)
Embedded Linux @ Information Technology Institute 4
Why Yocto?
● Develop using one common Linux OS for different architectures.
● Re-use your software stack with future devices.● Changing hardware platforms with updating just one line
in a config file and rebuild.● Base your work on a validated collection of software and
libraries.Developers spend lots of time porting or making build systems, leaves
less time and resources to develop value-adding software features.
![Page 5: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/5.jpg)
Embedded Linux @ Information Technology Institute 5
Yocto Project Overview
● OpenEmbedded (OE) – The overall build architecture used by the Yocto Project.
● BitBake – Task executor and scheduler.● Metadata – Task definitions.● Configuration (*.conf) – global definitions of variables.● Classes (*.bbclass) – encapsulation and inheritance of
build logic, packaging, etc.● Recipes (*.bb) – the logical units of software/images to
build.
![Page 6: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/6.jpg)
Embedded Linux @ Information Technology Institute 6
Yocto Project Overview (cont'd)
● OpenEmbedded Core (oe-core) – A core set of metadata shared by the OpenEmbedded and the Yocto Project.
● meta-yocto – Reference policy/distro configuration and reference hardware support layer.
● Poky – A pre-prepared combination of the build system components needed; also the name of our reference distro in meta-yocto
Poky = Bitbake + OE-core + meta-yocto + docs
![Page 7: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/7.jpg)
Embedded Linux @ Information Technology Institute 7
Yocto Key Concept (recipe)
● The Yocto Project provides tools and metadata for creating custom Linux images.
● These images are created from a repository of 'baked' recipes.
● A recipe is a set of instructions for building packages:– Where to obtain the upstream sources and which patches to
apply– Dependencies (on libraries or other recipes)– Configuration/compilation options– Define which files go into what output packages
![Page 8: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/8.jpg)
Embedded Linux @ Information Technology Institute 8
Yocto Workflow
![Page 9: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/9.jpg)
Embedded Linux @ Information Technology Institute 9
Yocto Member Organizations
![Page 10: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/10.jpg)
Embedded Linux @ Information Technology Institute 10
Working with Yocto
![Page 11: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/11.jpg)
Embedded Linux @ Information Technology Institute 11
Yocto First Shot● Download Yocto source
– All releases: http://downloads.yoctoproject.org/releases/yocto/
– Current final release: poky-dizzy-12.0.1.tar.bz2● Untar the downloaded file
$ tar xvf pokydizzy12.0.1.tar.bz2
● Go inside the project directory: $ cd pokydizzy12.0.1● Source the poky default environment script
$ source oeinitbuildenv
● Configure (if you want) your conf ile: $ vim conf/local.conf● Start the build process (and wait ….)
bitbake coreimageminimal
● Run Qemu emulator with output imagerunqemu qemux86
![Page 12: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/12.jpg)
Embedded Linux @ Information Technology Institute 12
Poky Directory Structure
● bitbake: the BitBake utility itself.● documentation: documentation sources.● scripts: various support scripts (e.g, runqemu)● meta/conf: important configuration files,
bitbake.conf, reference distro config, machine configs for QEMU architectures.
● meta/classes: BitBake classes.● meta/recipes-* : recipes for all packages & libs
![Page 13: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/13.jpg)
Embedded Linux @ Information Technology Institute 13
Recipe Skeleton
● Example of a recipe SUMMARY = “”
DISCRIPTION = “”
HOMEPAGE = “”
LICENSE = “”
SRC_URI = “”
SRC_URI[md5sum] = “”
inherit stuff
don't edit the poky default recipes, but create your own recipes & layers
![Page 14: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/14.jpg)
Embedded Linux @ Information Technology Institute 14
Yocto Configuration Files
● Build directory files● conf/bblayers.conf
– Contains locations for all layers needed for your build process.BBLAYERS ?= " \
/home/user/yocto/poky/metayocto \ ............
● conf/local.conf– Set your build options, choose target machine, add or remove features
from your build imageBB_NUMBER_THREADS = "threads"
PARALLEL_MAKE = "j threads"
MACHINE ?= "qemuarm"
DL_DIR ?= <downloaddirpath>
![Page 15: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/15.jpg)
Embedded Linux @ Information Technology Institute 15
Recipe build steps
● Building recipes involves executing the following functions, which can be overridden when needed for customizations.– do_fetch– do_unpack– do_patch– do_configure– do_compile– do_install– do_package
![Page 16: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/16.jpg)
Embedded Linux @ Information Technology Institute 16
Layers
● The Yocto Project build system is composed of layers.
● A layer is a logical collection of recipes representing the core, a Board Support Package (BSP), or an application stack.
● All layers have a priority and can override policy and config settings of the layers beneath it.
![Page 17: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/17.jpg)
Embedded Linux @ Information Technology Institute 17
Board Support Package (BSP)
● BSPs are layers to enable support for specific hardware platforms.
● Defines machine configuration for the “board”.● Adds machine-specific recipes and
customizations.– Kernel config– Graphics drivers (e.g, Xorg)– Additional recipes to support hardware features
![Page 18: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/18.jpg)
Embedded Linux @ Information Technology Institute 18
Yocto Layers Stacking
Developers-Specific Layer
Commercial Layer
UI - Optional Layer
Hardware Specific BSP
Yocto Layer Metadata (meta-yocto)
OpenEmbedded Core Metadata (oe-core)
![Page 19: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/19.jpg)
Embedded Linux @ Information Technology Institute 19
Useful Links
● Yocto Project quick start guide– yocto-project-qs
● Bitbake user manual– bitbake-user-manual
● Yocto Project development manual– dev-manual
![Page 20: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/20.jpg)
Embedded Linux @ Information Technology Institute 20
![Page 21: Yocto - Embedded Linux Distribution Maker](https://reader036.fdocuments.net/reader036/viewer/2022062308/55a7a0211a28ab32438b4718/html5/thumbnails/21.jpg)
Embedded Linux @ Information Technology Institute 21
http://about.me/shatrix