You are on page 1of 44

YOCTO PROJECT INTRODUCTION

Lecture: Võ Minh Huân


Group member:
• Trần Hữu Bảo Long 21161251
• Huỳnh Dương Tôn Lực 21161253
outline
• What is Yocto project?
• Yoctoproject workflow
• What is Yocto project?

• Overview
• Components
• Yocto Project vs OpenEmbedded
• Concept
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
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
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
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


2.Yocto project workflow
Overview of Yocto project workflow
Yocto project workflow configuration
• $ source oe-init-build-env [build_dir]
• $ build_dir> bitbake <target>
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
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
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
Configuration

- Machine settings are specified in a layer's conf/machine/xxx.conf


file(s)
• Sandy Bridge + Cougar Point
-meta-intel/conf/metsugarbay/machine/sugarbay.conf
• Routerstation Pro (MIPS)
-meta-yocto-bsp/conf/machine/routerstationpro.conf
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
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 customizatic
• Functional areas (selinux, networking, etc)
• OSV components
• Project level changes
• BSP/Machine specific components
Configuration Layer
expended
Scource 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
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
Patching
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 = "ro"
• 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}}
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"
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
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
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
System building process for
yocto project
After runing this command all essential host pakage now
installed on your build host
the end

You might also like