Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Stefano Cordibella - An introduction to Yocto Project

63 views

Published on

If you heard something about Yocto, bitbake, openembedded, layers, recipes and you want to know more about that, this talk is for you. In this presentation you will be introduced to the Yocto Project build system starting from the basic concepts of metadata up to the use of the build system “tasks” in order to create your own embedded linux distribution. I will start speaking about the pros and cons of the Yocto Project compared to the other embedded linux build systems. Then we go deep into the framework components: poky, openembedded core and bitbake. The practical use of the recipes, packagegroups, images and machines files will be explained by examples. Finally an example on how to integrate an extra layer will be showed demonstrating the ease of use and the modularity of the build system.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Stefano Cordibella - An introduction to Yocto Project

  1. 1. Software Embedded Applicazioni e Strumenti Software Soluzioni integrate Introduction to Yocto Project Stefano Cordibella 1
  2. 2. About Me • EDALab s.r.l. – 15+ collaborators – active from 2007 in Verona – main areas: • embedded solutions • wireless sensor network • HMI on touchscreen Stefano Cordibella 2
  3. 3. Agenda • Introduction: – Embedded Linux – Yocto Project • Openembedded Core: – directory structure – layer structure • Bitbake • Qt5 in Yocto Project Stefano Cordibella 3
  4. 4. Embedded Linux Operating systems based on Linux Kernel used in embedded systems. Pros: • complete system • high customization Cons: • need to manage heterogeneous software • many different tools to automate processes • update and maintain the whole system Stefano Cordibella 4
  5. 5. Yocto Project Suite of tools and metadata to build and manage your own linux distribution. • it is NOT a linux distro • it is a set of open source tools Advantages: • high level software management • hardware producer involved into the project • you can spend more time on your product Stefano Cordibella 5
  6. 6. Yocto Project Main components: • Yocto Project: umbrella project that maintains tools for embedded linux • Poky: Yocto Projects reference distro • Bitbake: build engine, metadata interpreter • Openembedded Core: metadata collection • 3rd parties metadata: for specific machine or software libraries Stefano Cordibella 6
  7. 7. Openembedded Core 7Stefano Cordibella
  8. 8. Openembedded Core • Organize the metadata in files called recipes. • Recipes are grouped in a modular structure called layers. • Contains about 1000 recipes for applications and libraries. Quick start: 1. download the Yocto Project code 2. run the setup script 3. select a target machine 4. run bitbake on the selected image. Stefano Cordibella 8
  9. 9. Openembedded Core Poky directory structure: • bitbake: build engine code and binary, • meta-* : layer directory A layer could be: • part of the oe core – meta-yocto-bsp • provided by a 3rd parties – meta-freescale, meta-qt5 • created by the user – meta-edalab Stefano Cordibella 9
  10. 10. Openembedded Core Layer entities: • Recipe: rules to create a software package • Package Group: set of packages • Image: data to create a root filesystem • Machine: definitions about the target platform • Distro: package version and feature definitions Stefano Cordibella 10
  11. 11. Recipes • Rules to create a binary or a software library. • Grouped in functional group named recipes-*. Stefano Cordibella 11
  12. 12. Recipes • Recipes are divided in logical block called tasks: – do_fecth: to download source code – do_patch, do_configure, do_compile: to build software – do_install, do_package: create package and deploy • Tasks can be extended or overwritten • Recipes can inherit from predefined build system: – autotools, cmake, qmake Stefano Cordibella 12
  13. 13. Recipes Stefano Cordibella 13
  14. 14. Recipes Stefano Cordibella 14
  15. 15. Package Groups • Set of recipes that can be managed like one entity. Stefano Cordibella 15
  16. 16. Images • List of software to install. • Features: – splash, – readonly rootfs, – debug tools, – … • File system type: – ext3, – jffs2, – … • Post process actions. Stefano Cordibella 16
  17. 17. Images Stefano Cordibella 17
  18. 18. Distro • Feature enable for the distro. • Specify package version number. • Disambiguate packages. Stefano Cordibella 18
  19. 19. Machine • Specify target architecture. • Feature supported by the hardware. • Memory region for bootloader, kernel. Stefano Cordibella 19
  20. 20. Bitbake 20Stefano Cordibella
  21. 21. Bitbake • Execute the tasks on a recipe or an image. • If a recipe has dependency it execute the dependency first creating the dependency graph. • Execute tasks in parallel. Examples: Execute all the tasks for the specified <recipe>, that could be an image. Stefano Cordibella 21
  22. 22. Bitbake Execute the single task <nometask> for the recipe <recipe> and terminate. Perform the clean task on the recipe. Show all the tasks for the recipe. Stefano Cordibella 22
  23. 23. Bitbake Open the development shell on the source code for the recipe after the do_patch task. The developer can make local changes on the sources and create patches for oe. Stefano Cordibella 23
  24. 24. Qt5 in Yocto Project 24Stefano Cordibella
  25. 25. Qt5 in Yocto Project Layer created to integrate qt5 framework in YP. Stefano Cordibella 25 • classes: definitions for qmake5 and cmake_qmake • recipes-qt: – how to compile the qt5 framework – recipes for the meta toolchain – application examples
  26. 26. Demo Time 26Stefano Cordibella
  27. 27. Thank you for your attention Any question? Stefano Cordibella 27

×