0% found this document useful (0 votes)
2 views

Yocto_Debian_Whitepaper

This white paper compares the Yocto Project and Debian for developing embedded Linux systems, highlighting their distinct approaches. Yocto is favored for customized, optimized systems requiring maintenance and traceability, while Debian is suitable for rapid prototyping with less customization. The paper emphasizes that while Debian may be easier to start with, Yocto provides better long-term benefits for industrial applications.

Uploaded by

ajithprasad25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Yocto_Debian_Whitepaper

This white paper compares the Yocto Project and Debian for developing embedded Linux systems, highlighting their distinct approaches. Yocto is favored for customized, optimized systems requiring maintenance and traceability, while Debian is suitable for rapid prototyping with less customization. The paper emphasizes that while Debian may be easier to start with, Yocto provides better long-term benefits for industrial applications.

Uploaded by

ajithprasad25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Yocto or Debian for Embedded Systems

White Paper

Document name:
Yocto/Debian Comparison White Paper
Document owner:
Mads Doré Hansen
Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 1(8)
Contents
1 Introduction .......................................................................................................................... 3
1.1 Executive Summary ........................................................................................................ 3

2 Linux System Parts and Development Short Overview ................................................... 4

3 Yocto vs. Debian .................................................................................................................. 5

Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 2(8)
1 Introduction
This white paper presents a comparison of the Yocto Project and Debian for development and
maintenance of an embedded Linux platform.

Strictly speaking, the term Linux refers to an operating system kernel, and not all the individual
parts that make up a complete system. A given configuration of Linux kernel, bootloader and
root-filesystem is referred to as a Linux Distribution.

In the context of this paper, Yocto means a Linux system based on the Yocto Project:

https://www.yoctoproject.org

Yocto is a tool to configuration full Linux Distribution and is not a Linux


distribution in itself.

And Debian means a Linux system based on:

https://www.debian.org

Debian is a Linux distribution (or a number of Linux basic distributions)


and is not a tool for making distributions in itself.

Hence different nature of Yocto and Debian a comparison of the two as foundation for
development and maintenance of embedded Linux systems will mostly be a comparison
between using a tool to make a customized Linux distribution or starting with a specific Linux
distribution and then change it into a partly customized Linux distribution.

1.1 Executive Summary


At present, using a Debian distribution as the foundation for an embedded Linux system will be
more proprietary, less portable to other hardware types, harder to maintain and with lower
traceability than using Yocto to build a similar embedded Linux system. The Debian based
system will require more resources (RAM / Storage) than a tightly adapted and optimized Yocto
based Linux system.

The discussion amongst Linux developers regarding Debian vs. Yocto is seldom based on facts
it is merely based on feeling and habits. As presented in this white paper Debian and Yocto
comparison is mostly like comparing apples and pears, they were not made to solve the same
problems. Shown in the fact based comparison of chapter 3 the two each have their strengths
and weaknesses.

 Debian is good for fast trials, proof of concept and desktop like environments on
hardware already supported by Debian with large memories and limited requirements
for maintenance, traceability and reuse across different hardware targets.

 Yocto is good for customized embedded environments with various hardware support
and small to large memories and requirements for maintenance, traceability, longevity
and reuse across difference hardware targets.

The two difference sets of strengths of Debian and Yocto sadly often results in Debian being
used for early prototyping (which makes sense) and afterwards being used for the final
customized Linux system, with the argument: “We have Debian already, must be cheaper to
continue than switch to Yocto”. The strength and weaknesses, as presented in chapter 3, shows
that it would in almost any longevity industrial Linux system by more rational to used Debian (or
other prebuilds) for early prototyping and switch to Yocto as soon as detailed customization is
started.
Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 3(8)
2 Linux System Parts and Development Short Overview
Regardless if a Linux distribution is based on Debian or Yocto the development environment
and final Embedded Linux Platform consists of the parts shown in the illustration below.

Embedded Linux Platform

Applications
Development Libraries
Host PC
High-level abstraction

Kernel
Linux
Network
File systems
Tools Protocols
Cross Compiler Low-level interfaces
Debugger
Meta data Bootloader
Source
HW

Cross compiling is almost only used for Yocto based systems, Debian mostly uses on target
compilation (therefore Cross Compiler is marked in Italic).

Steps involved in make a Linux distribution with the two difference approaches are shown
roughly below. Blue marking steps that the developer is without influence on and green marking
the steps the developer has influence on.

Debian steps
Customize
• Fetch basic
image
Build all Distribute to • Add packages
(Cross) compile Configure Final image
packages cloud • Remove
packages
• Recompile
kernel

Normally done manually or in


proprietary scripts of different
kind.

Yocto steps

Package Cross Final


Fetch sources Configure
selection compile image

Normally done in the recipe structure and syntax of Yocto.

Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 4(8)
3 Yocto vs. Debian
Even though the source code, kernel and bootloader is the same (or at lease often originate
from the same FOSS projects) the conceptual differences are huge in how everything is
developed. The main differences are shown in the following overview.

Issue Yocto Debian


Compilation Yocto fully relies on cross Dependent the HW platform in
compiling. question the Development Host
PC will have or not have a Cross
Some open source packages Compiler enabling e.g. compiling
was originally not designed for of kernel for a Debian based
cross compiling, putting stress on Linux system off-target. Most
use of these packages in a Yocto often Debian based systems rely
based system. But throughout on on-target compiling.
the last 5-10 years most common
Linux packages/features have be Debian is thereby stressed on
transferred to allow cross smaller targets. E.g. on-target
compiling. compiling of a Linux kernel on
So the discussion on using/not a 400MHz system is quite
using cross compilation is today slow.
often more a matter of habit than
technical difficulties.
Package/Feature addition Added through recipes into a full Added through package
firmware build (or single package installation on-target via the
build) with cross compilation on Debian Package manager.
the Development Host PC.
Either add only through full
firmware updates or a package
manager by choice (could be the
Debian package manager).

Using a package manager would


require the developer to build
that package in Yocto in the right
context.
Configuration and customization Each software package/feature Most software package/feature
of single features has its own recipe and/or meta- comes (partly) pre-build and
layer,that provides configuration configured, with is one of the
of how that package/feature is great advantages of getting a
build. Allowing full configuration running platform fast in Debian.
and customization of every detail
within the structured scope of This often results in fewer
Yocto. possible configuration and
customization possibilities, as the
All configuration can in Yocto be developer then relies on the
tracked and controlled between previous choices of the Debian
two updates of the system. package provider.

Full configuration and


customization of single features
in Debian thereby often leads to
manual, non-standadized,
compilations with harder or no
reproducibility.

It is hard to know if a given


configuration is/will be the same
between two updates of the
system.

Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 5(8)
Issue Yocto Debian
Configuration and customization The full platform is also As Debian is based mostly on
of the full platform configured and customized in prebuild packages a differently
recipes and/or meta-layers, configured/customized platform
enabling the possibility for most often means a complete
maximization of source and new separate Debian Linux in
meta-data reuse across both development and
differently configured/customized maintenance.
HW platforms.
E.g. if the same configuration is E.g. if the same configuration is
need both on an x86 and an need both on an x86 and an
ARM based HW the bootloader ARM based HW the full manual
configuration and kernel work is needed to make two
configuration is changed in Yocto Linux systems, one per HW to
and the full system is recompiled. support.
Allowing full reuse all other
software parts on both HW types. Often it is seen that this leads to
great variation on the features of
the Linux, as not all features
exists for both ARM and x86 in
same versions and configuration
in the pre-build Debian
packages.

For small custom systems a


Debian tool called debootstrap
exists, but has limitation as e.g.
ARM systems cannot be
configured on an x86 host.
Prevas have not seen this tool in
use at any of our customers yet,
the usual setup is proprietary and
home made.
Learning curve Yocto has a steeper learning Debian has a lower learning
curve than Debian, mostly due curve than Yocto, mostly due to:
to:
- Package installation
- Cross compiling. looks and feels like a
- Meta-layer concept. Desktop Linux.
- Recipe build-up. - First running system is
- “Non-forgiveness” of up fast.
missing dependencies.

The high learning curve is


often the most elaborated
reason the developers to avoid
Yocto.

Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 6(8)
Issue Yocto Debian
Reproducibility Is very high as everything (if not Is very low as the Package
made “messy” on purpose) is installation nature of Debian
recipe based and cross relies on cloud based pre-
compiled, often in a Docker compiled packages, ending up in
environment, with possible manually build gold-samples of
source mirroring. Enabling full the final Linux system.
automated builds in a build This is often counteracted by
server environment from scratch developers by build proprietary
without human interference. script based tools around Debian
working a given host machine,
adding customized knowledge
and making a steeper learning
curve for newcomers to a given
project.

Missing or extremely
expensive reproducibility is
the most common reason
companies discontinues
Debian based Linux’s and
switches to Yocto.
Patching The level of patching used in The patch level of Debian is
Yocto often limited, relying on often considered high as Debian
patches for each software is more generic and the project
package already available has some rules about how
upstream and the patches need Debian shall look.
to provide a build for the given
target platforms. Heavy patching results in more
complex systems with respect to
debug and maintenance, as
patches on patches make is a lot
harder to determine what code is
actually running on the system.
Likewise impact from updating
the lowest layer in that patch
stack is often impossible to
forsee.
Host tool dependencies Yocto is dependent on a number If on-target building is used and
of host tools to work. The list is manual packages installation
constantly getting shorter, but Debian does not have any critical
still is exists and will never go host tool dependencies.
away completely.
Often a reason for a quick
It has become good practice for selection of Debian, as it is
Yocto developers to use Docker very easy to get started on a
images as an efficient tool the generally good supported HW
overcome the final host tool platform.
dependencies, reducing them the
host being able to run a Linux
Docker image.
Scaling and Automation With request to scaling and Debian “golden copy” approach
automation of Linux development is not very feasible in respect to
onto multiple platforms and scaling to multiple HW types and
developers the recipe and meta- more developers.
layer approach of Yocto provides
significant advantages. Mostly as Likewise automated build/test
the work can be split efficiently requires proprietary tools and on-
between developers and target SW build is not very
build/test can be automated feasible for efficient automation
without human interference. and scaling.
FOSS license overview An overview of included licenses Must be manually extracted for
in a distribution is provided as each software feature included in
output from a Yocto build. the basic system and installed
with the package manager.

Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 7(8)
Issue Yocto Debian
Testing When the Linux system has been made the same testing possibilities
exists. The testing possibility differences only/mostly adheres to
automation of system build and cross-compiling SDK tests, address
tests of error occurring between SDK/cross-compiler for application
and the features available on the target.
Debugging The same tools are available for both Yocto and Debian.
A Debian there are bindings
between the Debian version
running on the host machine and
on the target. Without a match
the debug tools might not work.
Boot time optimization The nature of developing a It is most often seen that Debian
customized distribution bottom- based distribution is starting a
up usually provides “automatic” number of un-required services
optimization of boot time, with (as it is that nature of general
respect to a more general systems) and thereby adding the
distribution. boot-time.

Currently a project is running in


Prevas where similar
distributions is made for the
same project in both Yocto and
Debian. Current the Yocto based
distribution boots in about 10
seconds and the Debian based is
booting in about 60 seconds.
RootFS size As Yocto is used as a A commonly seen lightweight
configuration tool the root file Debian system is e.g. armbian
system is initially reduced and (Debian for ARM). This has a
the configuration can be 250MB gzipped root file system.
controlled to minimise the
footprint of the distribution to
“only what is actually needed”.

Current a project is running a


Prevas making a 30MB unzipped
root filesystem for an ARM board
in Yocto.

On the “standard” distributions with Graphics and without much


optimization the root file system footprints (unzipped) for the
embedded distributions are normally seen around:

Debian ~ 1 GB.
Yocto ~ 250 MB.

Kernel sizes Are the same for both types of systems.

Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 8(8)

You might also like