SlideShare una empresa de Scribd logo
1 de 44
Yocto Project Introduction
2015
issue.hsu@gmail.com
Outline
• What is Yocto Project
• Yocto Project Workflow
• References
2
What is Yocto Project
3
What is Yocto Project
• Overview
• Components
• Yocto Project VS OpenEmbedded
• Concept
4
Overview
• Yocto Project = Poky + Tools + Upstreams
5
Components
• Poky = BitBake + metadata
– Poky: reference build system used by the Yocto Project. It is a collection
of projects and tools, used to bootstrap a new distribution based on the
Yocto Project
– BitBake: the build engine. It is a task scheduler, like make. It interprets
configuration files and recipes (also called metadata) to perform a set of
tasks, to download, configure and build specified packages and
filesystem images
– Metadata: task configurations and definitions
• Metadata = configuration (.conf) + classes (.bbclass) + recipes
(.bb)
• OpenEmbedded Core
– a set of base layers. It is a set of recipes, layers and classes which are
shared between all OpenEmbedded based systems
6
Components
• Sub-Projects
– Hob: graphical user interface for BitBake
– Application Development Toolkit (ADT): development
environment for user-space applications to run on OS stacks built
by Poky
– Eclipse IDE Plugin: integration of ADT into the Eclipse IDE
– EGLIBC: embedded variant of the GNU C Library
– Matchbox: X windows-based open source graphical UI for
embedded devices
– Autobuilder: automation for Yocto Project build tests and QA
– Build Appliance: virtual machine image to try out the Yocto
Project and Poky
– Pseudo: system administrator simulation environment
– Swabber: host leakage detection tool 7
Yocto Project VS OpenEmbedded
• OpenEmbedded is an Open Source Project providing a
Build Framework for Embedded Linux Systems
– Not a reference distribution
– Designed to be the foundation for others
– Large library of recipes to cross-compile over 1000 packages
• The Yocto Project is focused on enabling Commercial
Product Development
– Provides a reference distribution policy and root file system
blueprints for building Linux OS stacks
– Co-maintains OpenEmbedded components and improves their
quality
– Provides additional tooling such as Autobuilder and QA Tests
– Provides tools for application development such as ADT and
Eclipse Plugin
8
Key Concept
• Bitbake will generate what you need according to the recipes
– 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, including:
• Where to obtain the upstream sources and which patches to apply
• Dependencies (on libraries or other recipes)
• Configuration/compilation options
• Define what files go into what output packages
9
Yocto Project Workflow
10
Overview of Yocto Project Workflow
11
Yocto Project Workflow Configurations
• $ source oe-init-build-env [build_dir]
• $ build_dir> bitbake <target>
12
Configuration
• User Configuration
– conf/local.conf – some things to set:
– Parallelism Options: Controlled by the
BB_NUMBER_THREADS, PARALLEL_MAKE, and
BB_NUMBER_PARSE_THREADS variables
– Target Machine Selection: Controlled by the MACHINE
variable
– Download Directory: Controlled by the DL_DIR variable
– Shared State Directory: Controlled by the SSTATE_DIR
variable
– Build Output: Controlled by the TMPDIR variable
13
Configuration
• Metadata and Patches:
– Recipes for building packages
– Eg, meta/recipes-core/coreutils/coreutils_6.9.bb builds
the core utilities (version 6.9) and installs them
– meta/recipes-core/coreutils/coreutils-6.9/ includes
patches, also could include extra files to install
– Can be extended and enhanced via “layers”
– Software layers contain user-supplied recipe files,
patches, and append files
14
Configuration
• BSPs and Machine Configurations:
– Configuration files to describe a machine
• Processor/SOC tuning files
– May include Linux kernel enhancements
– Includes board specific kernel configuration
– Machine specific package modifications
– BSP layers provide machine configurations
• conf/machine/machine.conf
• conf/layer.conf
• the layer is dedicated to specific recipes by function:
recipes-bsp, recipes-core, recipes-graphics, and recipes-
kernel
15
Configuration
– Machine settings are specified in a layer's
conf/machine/xxx.conf file(s)
• Sandy Bridge + Cougar Point
– meta-intel/conf/meta-
sugarbay/machine/sugarbay.conf
• Routerstation Pro (MIPS)
– meta-yocto-bsp/conf/machine/routerstationpro.conf
16
Configuration
• Policy Configurations:
– The distribution layer provides policy configurations
for your distribution
• classes: Class files (.bbclass) hold common
functionality that can be shared among recipes in the
distribution
• conf: This area holds configuration files for the layer
(conf/layer.conf), the distribution
(conf/distro/distro.conf), and any distribution-wide
include files
• recipes-*: Recipes and append files that affect common
functionality across the distribution. This area could
include recipes and append files to add distribution-
specific configuration, initialization scripts, custom
image recipes, and so forth
17
Yocto Project Layer
• Layers contain extensions and customizations to base system
– Can include image customizations, additional recipes, modifying recipes, adding
extra configuration
– Really just another directory to look for recipes or recipe extensions
– Added to the BBLAYERS variable in build/conf/bblayers.conf
• Layers are grouped by functional components
• Common Examples of Layers
– Custom Toolchains (compilers, debuggers, profiling tools, etc)
– Distribution specifications and customizations
– Functional areas (selinux, networking, etc)
– OSV components
– Project level changes
– BSP/Machine specific components
18
Configuration Layers expanded Figure
19
High-level Overview of Poky Task
Execution
• BitBake supports both _prepend and _append as a method of extending task functionality by
injecting code indicated by using prepend or append suffix into the beginning or end of a task.
20
Source Fetching
• Recipes call out location of all sources, whether on
the internet or local (Look for SRC_URI in *.bb files)
• Bitbake can get sources from git, svn, bzr, from
tarballs, and many, many more
• Versions of packages can be fixed or updated
automatically (Add SRCREV_pn- PN =
"${AUTOREV}” to local.conf)
• Yocto Project sources mirror available as a fallback,
if the sources move on the internet
21
Patching
• Once sources are obtained, the patches are
applied
• This is a good place to patch the software yourself
• However, we encourage you to contribute
development upstream whenever possible
22
Configuration/Compile
• Autoconf can be triggered automatically to ensure latest
libtool is used
DESCRIPTION = "GNU Helloworld application“
SECTION = "examples"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
PR = "r0"
SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.gz"
inherit autotools gettext
• CFLAGS can be set
CFLAGS_prepend = "-I ${S}/include "
• Install task to set modes, permissions, target directories,
done by “pseudo”
do_install () {
oe_runmake install DESTDIR=${D} SBINDIR=${sbindir}
MANDIR=${mandir} }
23
Packaging
• The most popular package formats are supported: RPM,
Debian, and ipk
– Set PACKAGE_CLASSES in conf/local.conf
• You can split into multiple packages using PACKAGES
and FILES in a *.bb file
– PACKAGES =+ "sxpm cxpm"
– FILES_cxpm = "${bindir}/cxpm"
– FILES_sxpm = "${bindir}/sxpm"
24
Image Generation
• Images are constructed using the packages built earlier in
the process
• Uses for these images:
– Live Image to boot a device
– Root filesystem for QEMU emulator
– Sysroot for App development
• Yocto Project lets you customize your embedded Linux OS
25
ADT Generation
• Cross toolchain and installation script generated
• This can be used to set up an application developer’s
cross development environment to create apps
• MACHINE=qemuarm bitbake poky-image-sato-sdk meta-
toolchain package-index
• QEMU built for target architecture emulation
26
Preparing for Application Development
27
Running on QEMU
$ git clone http://git.yoctoproject.org/git/poky
$ cd poky
$ git checkout -b fido origin/fido
$ source oe-init-build-env
$ MACHINE=qemuarm bitbake core-image-sato
$ runqemu qemuarm core-image-sato
$ MACHINE=qemuarm64 runqemu /path/to/image.bin
/path/to/rootfs_image.ext4
28
Reference
https://www.yoctoproject.org/docs/curren
t/yocto-project-qs/yocto-project-qs.html
Setting up the App Developer
29
• Package
Repository
(networked or
local)
• Sysroot (Bootable Linux
filesystem tree with
development headers)
• Cross toolchain
installation (such as:
/opt/poky)
System Developer
Application Developer
Yocto Project helps set up
the embedded application
development
BSP Developer's Guide
https://www.yoctoproject.org/docs/curren
t/bsp-guide/bsp-guide.html
Application Developer's Guide
http://www.yoctoproject.org/docs/current/
adt-manual/adt-manual.html
Cross-Development Toolchain
Generation
30
gcc-cross to build
target image
gcc-crosssdk to
produce relocatable
sdk that executes on
SDKMACHINE
gcc-cross-canadian that
executes on SDKMACHINE
and produces target
applications
Building a Toolchain Installer
• $ MACHINE=qemuarm bitbake meta-toolchain [-c populate_sdk]
• When the bitbake command completes, the toolchain installer will be
in tmp/deploy/sdk
• By default, this toolchain does not build static binaries
– If you want to use the toolchain to build these types of libraries, you need to be
sure your image has the appropriate static development libraries
– Use the IMAGE_INSTALL variable inside your local.conf file to install the
appropriate library packages
– Following is an example using glibc static development libraries:
• IMAGE_INSTALL_append = " glibc-staticdev"
31
Reference:
http://www.yoctoproject.org/docs/1.8/adt-manual/adt-
manual.html#optionally-building-a-toolchain-installer
Using a Cross-Toolchain Tarball
• Get your toolchain installer using one of the following methods
– Get it from http://downloads.yoctoproject.org/releases/yocto/yocto-1.8/toolchain/
– Build your own toolchain installer, like previous page
• tmp/deploy/sdk/
• Once you have the installer, run it to install the toolchain
– $ tmp/deploy/sdk/poky-glibc-i686-meta-toolchain-armv5e-toolchain-1.8.sh
– The first thing the installer prompts you for is the directory into which you want to
install the toolchain
• The default directory used is /opt/poky/1.8
32
Reference:
http://www.yoctoproject.org/docs/1.8/adt-manual/adt-
manual.html#using-an-existing-toolchain-tarball
Setting Up the Cross-Development
Environment
• $ /opt/poky/1.8/environment-setup-x86_64-poky-linux
• When you run the setup script, many environment variables are
defined
33
Reference:
http://www.yoctoproject.org/docs/1.8/adt-manual/adt-
manual.html#setting-up-the-cross-development-environment
• SDKTARGETSYSROOT - The path to the sysroot used for cross-
compilation
• PKG_CONFIG_PATH - The path to the target pkg-config files
• CONFIG_SITE - A GNU autoconf site file preconfigured for the
target
• CC - The minimal command and arguments to run the C compiler
• CXX - The minimal command and arguments to run the C++
compiler
• CPP - The minimal command and arguments to run the C
preprocessor
• AS - The minimal command and arguments to run the assembler
• LD - The minimal command and arguments to run the linker
• GDB - The minimal command and arguments to run the GNU
Debugger
• STRIP - The minimal command and arguments to run 'strip', which
strips symbols
• RANLIB - The minimal command and arguments to run 'ranlib‘
• OBJCOPY - The minimal command and arguments to run 'objcopy‘
• OBJDUMP - The minimal command and arguments to run
'objdump‘
• AR - The minimal command and arguments to run 'ar‘
• NM - The minimal command and arguments to run 'nm‘
• TARGET_PREFIX - The toolchain binary prefix for the target tools
• CROSS_COMPILE - The toolchain binary prefix for the target tools
• CONFIGURE_FLAGS - The minimal arguments for GNU configure
• CFLAGS - Suggested C flags
• CXXFLAGS - Suggested C++ flags
• LDFLAGS - Suggested linker flags when you use CC to link
• CPPFLAGS - Suggested preprocessor flags
Using an External Toolchain
• The fundamental steps you need to accomplish are as follows:
– Understand where the installed toolchain resides. For cases where you need to
build the external toolchain, you would need to take separate steps to build and
install the toolchain.
– Make sure you add the layer that contains the toolchain to your bblayers.conf file
through the BBLAYERS variable.
– Set the EXTERNAL_TOOLCHAIN variable in your local.conf file to the location in
which you installed the toolchain.
• A good example of an external toolchain used with the Yocto Project
is Mentor Graphics® Sourcery G++ Toolchain
– You can see information on how to use that particular layer in the README file at
http://github.com/MentorEmbedded/meta-sourcery/
– You can find further information by reading about the TCMODE variable in the
Yocto Project Reference Manual's variable glossary
34
Reference:
http://www.yoctoproject.org/docs/1.8/adt-manual/adt-
manual.html#optionally-using-an-external-toolchain
Extracting the Root Filesystem
• Here are some cases where you need to extract the root filesystem:
– You want to boot the image using NFS
– You want to use the root filesystem as the target sysroot. For example, the Eclipse
IDE environment with the Eclipse Yocto Plug-in installed allows you to use QEMU
to boot under NFS
– You want to develop your target application using the root filesystem as the target
sysroot
• Following is an example
– $ source /opt/poky/1.8/environment-setup-i586-poky-linux
– $ runqemu-extract-sdk core-image-sato-sdk-qemux86-
2011091411831.rootfs.tar.bz2 $HOME/qemux86-sato
35
References
36
Reference Manuals
• Yocto Project Reference Manual
– http://www.yoctoproject.org/docs/current/ref-manual/ref-
manual.html
• Yocto Project Development Manual
– http://www.yoctoproject.org/docs/1.8/dev-manual/dev-
manual.html
• Bitbake
– http://www.yoctoproject.org/docs/1.8/bitbake-user-
manual/bitbake-user-manual.html
37
Trainings and Tutorials
• Yocto Training from Free Electrons
– http://free-electrons.com/doc/training/yocto/yocto-slides.pdf
– http://free-electrons.com/doc/training/yocto/yocto-labs.pdf
• Developer Day 2014 Materials
– http://www.yoctoproject.org/bulk/devday-eu-2014/ypdd14-hallinan-intro-lab.pdf
• The Yocto Project: Introducing devtool
– https://drive.google.com/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view
– http://events.linuxfoundation.org/sites/events/files/slides/yocto_project_dev_workflow_elc_2015_0.pdf
• OpenEmbedded and Yocto introduction
– http://wiki.kaeilos.com/index.php/Setup_an_external_toolchain_with_Yocto
• http://10.19.133.152/wiki/doku.php?id=yocto
• http://www.crashcourse.ca/wiki/index.php/Yocto_FAQ
• Building your own recipes from first principles
– https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles
38
External Toolchain Reference
• https://wiki.linaro.org/KenWerner/Sandbox/OpenEmbedded-Core
• https://git.linaro.org/openembedded/meta-linaro.git
• http://www.rocketboards.org/foswiki/Documentation/YoctoDoraBuild
WithMetaAltera
• http://wiki.kaeilos.com/index.php/Setup_an_external_toolchain_with_
Yocto
• https://developer.ridgerun.com/wiki/index.php?title=Yocto_RR_SDK_I
ntegration
• http://elinux.org/images/c/c8/ExternalToolchainsInYocto.pdf
39
Modify Toolchain Options
• Toolchain component versions
– poky/meta/conf/distro/
• TCMODE
• TCLIBC
• GCCVERSION
• BINUVERSION
• GDBVERSION
• GLIBCVERSION
• Target machine options
– poky/meta/conf/macine/
• DEFAULTTUNE
• TUNEVALID
• AVAILTUNES
• TUNE_FEATURES
40
Other Important Variables
• Other define variables
– poky/meta/conf/documentation.conf
• SELECTED_OPTIMIZATION
• FULL_OPTIMIZATION
• BUILD_OPTIMIZATION
• OVERRIDES
– http://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-
manual.html#conditional-syntax-overrides
– http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-
varlocality
– http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-
variables-glos
– http://www.embeddedlinux.org.cn/OEManual/recipes_directories.html
41
Built Toolchains
• Glibc @sanji
– meta-toolchain @ branch master
• armv5+gcc-4.9 / armv5+gcc-5.2 ok
• arm64+gcc-5.2 ok
• armv7a+gcc-5.2 ok
• Uclibc @yacc
– meta-toolchain @ branch master
• armv5+gcc-4.9 / armv5+gcc-5.2 ok
• Musl @usopp
– Have to add meta-musl layer. git clone https://github.com/kraj/meta-musl
– meta-toolchain @ master
• armv5+gcc-4.9 / armv5+gcc-5.2 ok
• arm64+gcc-5.2 ok
• armv7a+gcc-5.2 ok
42
Built Images
• Glibc @sanji
– core-image-sato @ branch master
• armv5+gcc-4.9 / armv5+gcc-5.2 ok
• arm64+gcc-5.2 ok
• armv7a+gcc-5.2 ok
• Uclibc @yacc
– core-image-minimal @ branch master
• armv5+gcc-4.9 / armv5+gcc-5.2 ok
• Musl @usopp
– Have to add meta-musl layer. git clone https://github.com/kraj/meta-musl
– core-image-minimal @ master
• armv5+gcc-5.2 ok
• arm64+gcc-5.2 ok
• armv7a+gcc-5.2 ok
• runqemu
– Both armv5 and arm64 core-image-minimal build with glibc gcc-4.9/gcc-5.2 can boot with
qemu
– uclibc/musl and armv7 core-image-minimal are failed to boot the kernel
43
Speed up the build
• http://stackoverflow.com/questions/18074979/methods-for-speeding-
up-build-time-in-a-project-using-bitbake
• http://www.yoctoproject.org/docs/latest/ref-manual/ref-
manual.html#speeding-up-the-build
44

Más contenido relacionado

La actualidad más candente

Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerSherif Mousa
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingStephan Cadene
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Thomas Petazzoni
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernelguest547d74
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linuxsureskal
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in EnglishOtavio Salvador
 
Introduction Linux Device Drivers
Introduction Linux Device DriversIntroduction Linux Device Drivers
Introduction Linux Device DriversNEEVEE Technologies
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
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
 
Secure boot general
Secure boot generalSecure boot general
Secure boot generalPrabhu Swamy
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot) Omkar Rane
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 

La actualidad más candente (20)

Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution Maker
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 
Introduction Linux Device Drivers
Introduction Linux Device DriversIntroduction Linux Device Drivers
Introduction Linux Device Drivers
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
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...
 
Secure boot general
Secure boot generalSecure boot general
Secure boot general
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 

Similar a Yocto Project introduction

Yocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux DistributionYocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux Distributionemertxemarketing
 
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
 
yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notesSteve Arnold
 
Generating a Reproducible and Maintainable Embedded Linux Environment with Po...
Generating a Reproducible and Maintainable Embedded Linux Environment with Po...Generating a Reproducible and Maintainable Embedded Linux Environment with Po...
Generating a Reproducible and Maintainable Embedded Linux Environment with Po...LF Events
 
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
 
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...melbats
 
OpenEmbedded & BitBake - Denx
OpenEmbedded & BitBake - DenxOpenEmbedded & BitBake - Denx
OpenEmbedded & BitBake - Denxyang firo
 
DevOps: Arquitectura, Estrategia y Modelo
DevOps: Arquitectura, Estrategia y ModeloDevOps: Arquitectura, Estrategia y Modelo
DevOps: Arquitectura, Estrategia y ModeloSUSE España
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Qualcomm Developer Network
 
Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018Mender.io
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnTrevor Woerner
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Max Romanovsky
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovskyphp-user-group-minsk
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERIndrajit Poddar
 
Princeton RSE Peer network first meeting
Princeton RSE Peer network first meetingPrinceton RSE Peer network first meeting
Princeton RSE Peer network first meetingHenry Schreiner
 
Building Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto projectBuilding Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto projecttwcoimbatore
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems Mender.io
 
Win ce 6.0 development (1)
Win ce 6.0 development (1)Win ce 6.0 development (1)
Win ce 6.0 development (1)Rajshree Daware
 

Similar a Yocto Project introduction (20)

Yocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux DistributionYocto Project : Custom Embedded Linux Distribution
Yocto Project : Custom Embedded Linux Distribution
 
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
 
yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notes
 
Generating a Reproducible and Maintainable Embedded Linux Environment with Po...
Generating a Reproducible and Maintainable Embedded Linux Environment with Po...Generating a Reproducible and Maintainable Embedded Linux Environment with Po...
Generating a Reproducible and Maintainable Embedded Linux Environment with Po...
 
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
 
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
 
OpenEmbedded & BitBake - Denx
OpenEmbedded & BitBake - DenxOpenEmbedded & BitBake - Denx
OpenEmbedded & BitBake - Denx
 
Building Embedded Linux UDOONEO
Building Embedded Linux UDOONEOBuilding Embedded Linux UDOONEO
Building Embedded Linux UDOONEO
 
DevOps: Arquitectura, Estrategia y Modelo
DevOps: Arquitectura, Estrategia y ModeloDevOps: Arquitectura, Estrategia y Modelo
DevOps: Arquitectura, Estrategia y Modelo
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
 
Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018Embedded Linux Build Systems - Texas Linux Fest 2018
Embedded Linux Build Systems - Texas Linux Fest 2018
 
OpenEmbedded
OpenEmbeddedOpenEmbedded
OpenEmbedded
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-On
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
 
Princeton RSE Peer network first meeting
Princeton RSE Peer network first meetingPrinceton RSE Peer network first meeting
Princeton RSE Peer network first meeting
 
Building Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto projectBuilding Emmbedded Linux with Yocto project
Building Emmbedded Linux with Yocto project
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems
 
Win ce 6.0 development (1)
Win ce 6.0 development (1)Win ce 6.0 development (1)
Win ce 6.0 development (1)
 

Más de Yi-Hsiu Hsu

Glow introduction
Glow introductionGlow introduction
Glow introductionYi-Hsiu Hsu
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about CYi-Hsiu Hsu
 
Introduction to memory order consume
Introduction to memory order consumeIntroduction to memory order consume
Introduction to memory order consumeYi-Hsiu Hsu
 
RISC-V Introduction
RISC-V IntroductionRISC-V Introduction
RISC-V IntroductionYi-Hsiu Hsu
 
GCC for ARMv8 Aarch64
GCC for ARMv8 Aarch64GCC for ARMv8 Aarch64
GCC for ARMv8 Aarch64Yi-Hsiu Hsu
 
Introduction to armv8 aarch64
Introduction to armv8 aarch64Introduction to armv8 aarch64
Introduction to armv8 aarch64Yi-Hsiu Hsu
 

Más de Yi-Hsiu Hsu (8)

Glow introduction
Glow introductionGlow introduction
Glow introduction
 
TensorRT survey
TensorRT surveyTensorRT survey
TensorRT survey
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about C
 
Introduction to memory order consume
Introduction to memory order consumeIntroduction to memory order consume
Introduction to memory order consume
 
RISC-V Introduction
RISC-V IntroductionRISC-V Introduction
RISC-V Introduction
 
Memory model
Memory modelMemory model
Memory model
 
GCC for ARMv8 Aarch64
GCC for ARMv8 Aarch64GCC for ARMv8 Aarch64
GCC for ARMv8 Aarch64
 
Introduction to armv8 aarch64
Introduction to armv8 aarch64Introduction to armv8 aarch64
Introduction to armv8 aarch64
 

Último

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
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
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
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
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
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
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
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
 
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
 

Último (20)

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
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
 
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
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
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 - ...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
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
 
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
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
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
 
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
 

Yocto Project introduction

  • 2. Outline • What is Yocto Project • Yocto Project Workflow • References 2
  • 3. What is Yocto Project 3
  • 4. What is Yocto Project • Overview • Components • Yocto Project VS OpenEmbedded • Concept 4
  • 5. Overview • Yocto Project = Poky + Tools + Upstreams 5
  • 6. Components • Poky = BitBake + metadata – Poky: reference build system used by the Yocto Project. It is a collection of projects and tools, used to bootstrap a new distribution based on the Yocto Project – BitBake: the build engine. It is a task scheduler, like make. It interprets configuration files and recipes (also called metadata) to perform a set of tasks, to download, configure and build specified packages and filesystem images – Metadata: task configurations and definitions • Metadata = configuration (.conf) + classes (.bbclass) + recipes (.bb) • OpenEmbedded Core – a set of base layers. It is a set of recipes, layers and classes which are shared between all OpenEmbedded based systems 6
  • 7. Components • Sub-Projects – Hob: graphical user interface for BitBake – Application Development Toolkit (ADT): development environment for user-space applications to run on OS stacks built by Poky – Eclipse IDE Plugin: integration of ADT into the Eclipse IDE – EGLIBC: embedded variant of the GNU C Library – Matchbox: X windows-based open source graphical UI for embedded devices – Autobuilder: automation for Yocto Project build tests and QA – Build Appliance: virtual machine image to try out the Yocto Project and Poky – Pseudo: system administrator simulation environment – Swabber: host leakage detection tool 7
  • 8. Yocto Project VS OpenEmbedded • OpenEmbedded is an Open Source Project providing a Build Framework for Embedded Linux Systems – Not a reference distribution – Designed to be the foundation for others – Large library of recipes to cross-compile over 1000 packages • The Yocto Project is focused on enabling Commercial Product Development – Provides a reference distribution policy and root file system blueprints for building Linux OS stacks – Co-maintains OpenEmbedded components and improves their quality – Provides additional tooling such as Autobuilder and QA Tests – Provides tools for application development such as ADT and Eclipse Plugin 8
  • 9. Key Concept • Bitbake will generate what you need according to the recipes – 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, including: • Where to obtain the upstream sources and which patches to apply • Dependencies (on libraries or other recipes) • Configuration/compilation options • Define what files go into what output packages 9
  • 11. Overview of Yocto Project Workflow 11
  • 12. Yocto Project Workflow Configurations • $ source oe-init-build-env [build_dir] • $ build_dir> bitbake <target> 12
  • 13. Configuration • User Configuration – conf/local.conf – some things to set: – Parallelism Options: Controlled by the BB_NUMBER_THREADS, PARALLEL_MAKE, and BB_NUMBER_PARSE_THREADS variables – Target Machine Selection: Controlled by the MACHINE variable – Download Directory: Controlled by the DL_DIR variable – Shared State Directory: Controlled by the SSTATE_DIR variable – Build Output: Controlled by the TMPDIR variable 13
  • 14. Configuration • Metadata and Patches: – Recipes for building packages – Eg, meta/recipes-core/coreutils/coreutils_6.9.bb builds the core utilities (version 6.9) and installs them – meta/recipes-core/coreutils/coreutils-6.9/ includes patches, also could include extra files to install – Can be extended and enhanced via “layers” – Software layers contain user-supplied recipe files, patches, and append files 14
  • 15. Configuration • BSPs and Machine Configurations: – Configuration files to describe a machine • Processor/SOC tuning files – May include Linux kernel enhancements – Includes board specific kernel configuration – Machine specific package modifications – BSP layers provide machine configurations • conf/machine/machine.conf • conf/layer.conf • the layer is dedicated to specific recipes by function: recipes-bsp, recipes-core, recipes-graphics, and recipes- kernel 15
  • 16. Configuration – Machine settings are specified in a layer's conf/machine/xxx.conf file(s) • Sandy Bridge + Cougar Point – meta-intel/conf/meta- sugarbay/machine/sugarbay.conf • Routerstation Pro (MIPS) – meta-yocto-bsp/conf/machine/routerstationpro.conf 16
  • 17. Configuration • Policy Configurations: – The distribution layer provides policy configurations for your distribution • classes: Class files (.bbclass) hold common functionality that can be shared among recipes in the distribution • conf: This area holds configuration files for the layer (conf/layer.conf), the distribution (conf/distro/distro.conf), and any distribution-wide include files • recipes-*: Recipes and append files that affect common functionality across the distribution. This area could include recipes and append files to add distribution- specific configuration, initialization scripts, custom image recipes, and so forth 17
  • 18. Yocto Project Layer • Layers contain extensions and customizations to base system – Can include image customizations, additional recipes, modifying recipes, adding extra configuration – Really just another directory to look for recipes or recipe extensions – Added to the BBLAYERS variable in build/conf/bblayers.conf • Layers are grouped by functional components • Common Examples of Layers – Custom Toolchains (compilers, debuggers, profiling tools, etc) – Distribution specifications and customizations – Functional areas (selinux, networking, etc) – OSV components – Project level changes – BSP/Machine specific components 18
  • 20. High-level Overview of Poky Task Execution • BitBake supports both _prepend and _append as a method of extending task functionality by injecting code indicated by using prepend or append suffix into the beginning or end of a task. 20
  • 21. Source Fetching • Recipes call out location of all sources, whether on the internet or local (Look for SRC_URI in *.bb files) • Bitbake can get sources from git, svn, bzr, from tarballs, and many, many more • Versions of packages can be fixed or updated automatically (Add SRCREV_pn- PN = "${AUTOREV}” to local.conf) • Yocto Project sources mirror available as a fallback, if the sources move on the internet 21
  • 22. Patching • Once sources are obtained, the patches are applied • This is a good place to patch the software yourself • However, we encourage you to contribute development upstream whenever possible 22
  • 23. Configuration/Compile • Autoconf can be triggered automatically to ensure latest libtool is used DESCRIPTION = "GNU Helloworld application“ SECTION = "examples" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" PR = "r0" SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.gz" inherit autotools gettext • CFLAGS can be set CFLAGS_prepend = "-I ${S}/include " • Install task to set modes, permissions, target directories, done by “pseudo” do_install () { oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} } 23
  • 24. Packaging • The most popular package formats are supported: RPM, Debian, and ipk – Set PACKAGE_CLASSES in conf/local.conf • You can split into multiple packages using PACKAGES and FILES in a *.bb file – PACKAGES =+ "sxpm cxpm" – FILES_cxpm = "${bindir}/cxpm" – FILES_sxpm = "${bindir}/sxpm" 24
  • 25. Image Generation • Images are constructed using the packages built earlier in the process • Uses for these images: – Live Image to boot a device – Root filesystem for QEMU emulator – Sysroot for App development • Yocto Project lets you customize your embedded Linux OS 25
  • 26. ADT Generation • Cross toolchain and installation script generated • This can be used to set up an application developer’s cross development environment to create apps • MACHINE=qemuarm bitbake poky-image-sato-sdk meta- toolchain package-index • QEMU built for target architecture emulation 26
  • 27. Preparing for Application Development 27
  • 28. Running on QEMU $ git clone http://git.yoctoproject.org/git/poky $ cd poky $ git checkout -b fido origin/fido $ source oe-init-build-env $ MACHINE=qemuarm bitbake core-image-sato $ runqemu qemuarm core-image-sato $ MACHINE=qemuarm64 runqemu /path/to/image.bin /path/to/rootfs_image.ext4 28 Reference https://www.yoctoproject.org/docs/curren t/yocto-project-qs/yocto-project-qs.html
  • 29. Setting up the App Developer 29 • Package Repository (networked or local) • Sysroot (Bootable Linux filesystem tree with development headers) • Cross toolchain installation (such as: /opt/poky) System Developer Application Developer Yocto Project helps set up the embedded application development BSP Developer's Guide https://www.yoctoproject.org/docs/curren t/bsp-guide/bsp-guide.html Application Developer's Guide http://www.yoctoproject.org/docs/current/ adt-manual/adt-manual.html
  • 30. Cross-Development Toolchain Generation 30 gcc-cross to build target image gcc-crosssdk to produce relocatable sdk that executes on SDKMACHINE gcc-cross-canadian that executes on SDKMACHINE and produces target applications
  • 31. Building a Toolchain Installer • $ MACHINE=qemuarm bitbake meta-toolchain [-c populate_sdk] • When the bitbake command completes, the toolchain installer will be in tmp/deploy/sdk • By default, this toolchain does not build static binaries – If you want to use the toolchain to build these types of libraries, you need to be sure your image has the appropriate static development libraries – Use the IMAGE_INSTALL variable inside your local.conf file to install the appropriate library packages – Following is an example using glibc static development libraries: • IMAGE_INSTALL_append = " glibc-staticdev" 31 Reference: http://www.yoctoproject.org/docs/1.8/adt-manual/adt- manual.html#optionally-building-a-toolchain-installer
  • 32. Using a Cross-Toolchain Tarball • Get your toolchain installer using one of the following methods – Get it from http://downloads.yoctoproject.org/releases/yocto/yocto-1.8/toolchain/ – Build your own toolchain installer, like previous page • tmp/deploy/sdk/ • Once you have the installer, run it to install the toolchain – $ tmp/deploy/sdk/poky-glibc-i686-meta-toolchain-armv5e-toolchain-1.8.sh – The first thing the installer prompts you for is the directory into which you want to install the toolchain • The default directory used is /opt/poky/1.8 32 Reference: http://www.yoctoproject.org/docs/1.8/adt-manual/adt- manual.html#using-an-existing-toolchain-tarball
  • 33. Setting Up the Cross-Development Environment • $ /opt/poky/1.8/environment-setup-x86_64-poky-linux • When you run the setup script, many environment variables are defined 33 Reference: http://www.yoctoproject.org/docs/1.8/adt-manual/adt- manual.html#setting-up-the-cross-development-environment • SDKTARGETSYSROOT - The path to the sysroot used for cross- compilation • PKG_CONFIG_PATH - The path to the target pkg-config files • CONFIG_SITE - A GNU autoconf site file preconfigured for the target • CC - The minimal command and arguments to run the C compiler • CXX - The minimal command and arguments to run the C++ compiler • CPP - The minimal command and arguments to run the C preprocessor • AS - The minimal command and arguments to run the assembler • LD - The minimal command and arguments to run the linker • GDB - The minimal command and arguments to run the GNU Debugger • STRIP - The minimal command and arguments to run 'strip', which strips symbols • RANLIB - The minimal command and arguments to run 'ranlib‘ • OBJCOPY - The minimal command and arguments to run 'objcopy‘ • OBJDUMP - The minimal command and arguments to run 'objdump‘ • AR - The minimal command and arguments to run 'ar‘ • NM - The minimal command and arguments to run 'nm‘ • TARGET_PREFIX - The toolchain binary prefix for the target tools • CROSS_COMPILE - The toolchain binary prefix for the target tools • CONFIGURE_FLAGS - The minimal arguments for GNU configure • CFLAGS - Suggested C flags • CXXFLAGS - Suggested C++ flags • LDFLAGS - Suggested linker flags when you use CC to link • CPPFLAGS - Suggested preprocessor flags
  • 34. Using an External Toolchain • The fundamental steps you need to accomplish are as follows: – Understand where the installed toolchain resides. For cases where you need to build the external toolchain, you would need to take separate steps to build and install the toolchain. – Make sure you add the layer that contains the toolchain to your bblayers.conf file through the BBLAYERS variable. – Set the EXTERNAL_TOOLCHAIN variable in your local.conf file to the location in which you installed the toolchain. • A good example of an external toolchain used with the Yocto Project is Mentor Graphics® Sourcery G++ Toolchain – You can see information on how to use that particular layer in the README file at http://github.com/MentorEmbedded/meta-sourcery/ – You can find further information by reading about the TCMODE variable in the Yocto Project Reference Manual's variable glossary 34 Reference: http://www.yoctoproject.org/docs/1.8/adt-manual/adt- manual.html#optionally-using-an-external-toolchain
  • 35. Extracting the Root Filesystem • Here are some cases where you need to extract the root filesystem: – You want to boot the image using NFS – You want to use the root filesystem as the target sysroot. For example, the Eclipse IDE environment with the Eclipse Yocto Plug-in installed allows you to use QEMU to boot under NFS – You want to develop your target application using the root filesystem as the target sysroot • Following is an example – $ source /opt/poky/1.8/environment-setup-i586-poky-linux – $ runqemu-extract-sdk core-image-sato-sdk-qemux86- 2011091411831.rootfs.tar.bz2 $HOME/qemux86-sato 35
  • 37. Reference Manuals • Yocto Project Reference Manual – http://www.yoctoproject.org/docs/current/ref-manual/ref- manual.html • Yocto Project Development Manual – http://www.yoctoproject.org/docs/1.8/dev-manual/dev- manual.html • Bitbake – http://www.yoctoproject.org/docs/1.8/bitbake-user- manual/bitbake-user-manual.html 37
  • 38. Trainings and Tutorials • Yocto Training from Free Electrons – http://free-electrons.com/doc/training/yocto/yocto-slides.pdf – http://free-electrons.com/doc/training/yocto/yocto-labs.pdf • Developer Day 2014 Materials – http://www.yoctoproject.org/bulk/devday-eu-2014/ypdd14-hallinan-intro-lab.pdf • The Yocto Project: Introducing devtool – https://drive.google.com/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view – http://events.linuxfoundation.org/sites/events/files/slides/yocto_project_dev_workflow_elc_2015_0.pdf • OpenEmbedded and Yocto introduction – http://wiki.kaeilos.com/index.php/Setup_an_external_toolchain_with_Yocto • http://10.19.133.152/wiki/doku.php?id=yocto • http://www.crashcourse.ca/wiki/index.php/Yocto_FAQ • Building your own recipes from first principles – https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles 38
  • 39. External Toolchain Reference • https://wiki.linaro.org/KenWerner/Sandbox/OpenEmbedded-Core • https://git.linaro.org/openembedded/meta-linaro.git • http://www.rocketboards.org/foswiki/Documentation/YoctoDoraBuild WithMetaAltera • http://wiki.kaeilos.com/index.php/Setup_an_external_toolchain_with_ Yocto • https://developer.ridgerun.com/wiki/index.php?title=Yocto_RR_SDK_I ntegration • http://elinux.org/images/c/c8/ExternalToolchainsInYocto.pdf 39
  • 40. Modify Toolchain Options • Toolchain component versions – poky/meta/conf/distro/ • TCMODE • TCLIBC • GCCVERSION • BINUVERSION • GDBVERSION • GLIBCVERSION • Target machine options – poky/meta/conf/macine/ • DEFAULTTUNE • TUNEVALID • AVAILTUNES • TUNE_FEATURES 40
  • 41. Other Important Variables • Other define variables – poky/meta/conf/documentation.conf • SELECTED_OPTIMIZATION • FULL_OPTIMIZATION • BUILD_OPTIMIZATION • OVERRIDES – http://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user- manual.html#conditional-syntax-overrides – http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref- varlocality – http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref- variables-glos – http://www.embeddedlinux.org.cn/OEManual/recipes_directories.html 41
  • 42. Built Toolchains • Glibc @sanji – meta-toolchain @ branch master • armv5+gcc-4.9 / armv5+gcc-5.2 ok • arm64+gcc-5.2 ok • armv7a+gcc-5.2 ok • Uclibc @yacc – meta-toolchain @ branch master • armv5+gcc-4.9 / armv5+gcc-5.2 ok • Musl @usopp – Have to add meta-musl layer. git clone https://github.com/kraj/meta-musl – meta-toolchain @ master • armv5+gcc-4.9 / armv5+gcc-5.2 ok • arm64+gcc-5.2 ok • armv7a+gcc-5.2 ok 42
  • 43. Built Images • Glibc @sanji – core-image-sato @ branch master • armv5+gcc-4.9 / armv5+gcc-5.2 ok • arm64+gcc-5.2 ok • armv7a+gcc-5.2 ok • Uclibc @yacc – core-image-minimal @ branch master • armv5+gcc-4.9 / armv5+gcc-5.2 ok • Musl @usopp – Have to add meta-musl layer. git clone https://github.com/kraj/meta-musl – core-image-minimal @ master • armv5+gcc-5.2 ok • arm64+gcc-5.2 ok • armv7a+gcc-5.2 ok • runqemu – Both armv5 and arm64 core-image-minimal build with glibc gcc-4.9/gcc-5.2 can boot with qemu – uclibc/musl and armv7 core-image-minimal are failed to boot the kernel 43
  • 44. Speed up the build • http://stackoverflow.com/questions/18074979/methods-for-speeding- up-build-time-in-a-project-using-bitbake • http://www.yoctoproject.org/docs/latest/ref-manual/ref- manual.html#speeding-up-the-build 44