Yocto_Debian_Whitepaper
Yocto_Debian_Whitepaper
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
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
https://www.debian.org
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.
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.
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
Yocto steps
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.
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.
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.
Debian ~ 1 GB.
Yocto ~ 250 MB.
Filename: Modified:
Yocto_Debian_Whitepaper 2017-08-09
Classification: Client: Project/Process: Version: Page:
Public Prevas White Paper R1 8(8)