Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Yocto for Raspberry Pi

You're reading from  Yocto for Raspberry Pi

Product type Book
Published in Jun 2016
Publisher Packt
ISBN-13 9781785281952
Pages 214 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
TEXIER Pierre-Jean TEXIER Pierre-Jean
Profile icon TEXIER Pierre-Jean
Petter Mabäcker Petter Mabäcker
Profile icon Petter Mabäcker
View More author details

Table of Contents (18) Chapters

Yocto for Raspberry Pi
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Meeting the Yocto Project Building our First Poky Image for the Raspberry Pi Mastering Baking with Hob and Toaster Understanding BitBake Creating, Developing, and Deploying on the Raspberry Pi Working with External Layers Deploying a Custom Layer on the Raspberry Pi Diving into the Raspberry Pi's Peripherals and Yocto Recipes Making a Media Hub on the Raspberry Pi Playing with an LCD Touchscreen and the Linux Kernel Contributing to the Raspberry Pi BSP Layer Home Automation Project - Booting a Custom Image

Chapter 6. Working with External Layers

Throughout this chapter, we will discover the basic concept of external layers and understand layer types and how they are built (by priority, name, and so on). We will also discuss about the Qt5 and web server layers.

After that, we will integrate an external layer to our build and test it on the Raspberry Pi.

Introducing layers


A layer is just a collection of recipes and/or configuration that can be used on top of Yocto/OE-Core.

The advantage of using an environment such as Yocto/OE (the Poky reference system) comes from the fact that this project handles a lot of metadata (definition files (.conf) of the machine (Raspberry Pi), classes, and recipes (.bb)) that covers everything from simple applications (gpio-packt) to graphics applications such as OpenGLES, EFL, or Qt.

The main motivation of using layers is to organize the long list of providers better and still make sure users may be able to pick only the required or desired provider. It is also a way of providing customizable source code that can be used for any architecture or modified in the way the user needs.

The other advantage is that we can choose all the layers required for each project (from the most basic to the most complex). We can modify them to be consistent with our architecture (ARM for the Raspberry Pi), but a layer can be reused...

The basic concepts of layers


Let's dive into the basic concepts of layers:

Theory

A layer, in the technical sense of the term, has some properties. They are as follows:

  • Name: This usually starts with the string meta- (mandatory for better comprehension).

  • Priority: This is the value used by BitBake to decide which recipe to use and the order in which the .bbappend files should be joined. It means that if two layers include the same recipe (.bb) file, the one with the higher priority is used.

Note

For example, a layer with a priority value set to 6 has a higher chance of its recipe being used than one with a priority value set to 5.

Furthermore, each layer is listed according to its functionality on this page:

http://layers.openembedded.org/layerindex/branch/master/layers/

  • The software layer:  This layer provides software families that can be used on any architecture (x86_64, ARM, PPC, MIPS, and so on). For example, we have meta-java (for Java support), meta-efl (for the Enlightenment environment...

Adding external layers to the Raspberry Pi


Now that we know how a layer works, we can add an existing external layer to our environment. To do this, we'll be working with meta-webserver ( http://layers.openembedded.org/layerindex/branch/master/layer/meta-webserver/ ) in order to include the famous web server, Monkey (http://monkey-project.com/).

As you know, the first step consists of modifying our conf/bblayers.conf file in order to add the path of the layer, as follows:

# LAYER_CONF_VERSION is increased each time  
build/conf/bblayers.conf 
# changes incompatibly 
LCONF_VERSION = "6" 
BBPATH = "${TOPDIR}" 
BBFILES ?= "" 
BBLAYERS ?= " \ 
  /home/packt/RASPBERRYPI/poky/meta \ 
  /home/packt/RASPBERRYPI/poky/meta-yocto \ 
  /home/packt/RASPBERRYPI/poky/meta-yocto-bsp \ 
  /home/packt/RASPBERRYPI/poky/meta-raspberrypi \ 
  /home/packt/RASPBERRYPI/poky/meta-openembedded/meta-webserver \ 
 
  " 
BBLAYERS_NON_REMOVABLE ?= "...

Summary


In this chapter, we discovered the main principle of the layers inside the Poky distribution. We learned how a layer works, how to integrate an external layer to our Raspberry Pi projects, and how to generate a custom image.

We'll discuss layers in the next chapter as well, but we'll create our custom layer in order to integrate it to an image for the Raspberry Pi.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Yocto for Raspberry Pi
Published in: Jun 2016 Publisher: Packt ISBN-13: 9781785281952
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}