Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Embedded Linux Development Using Yocto Project

You're reading from   Embedded Linux Development Using Yocto Project Leverage the power of the Yocto Project to build efficient Linux-based products

Arrow left icon
Product type Paperback
Published in Apr 2023
Publisher Packt
ISBN-13 9781804615065
Length 196 pages
Edition 3rd Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Otavio Salvador Otavio Salvador
Author Profile Icon Otavio Salvador
Otavio Salvador
Daiane Angolini Daiane Angolini
Author Profile Icon Daiane Angolini
Daiane Angolini
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Chapter 1: Meeting the Yocto Project 2. Chapter 2: Baking Our First Poky-Based System FREE CHAPTER 3. Chapter 3: Using Toaster to Bake an Image 4. Chapter 4: Meeting the BitBake Tool 5. Chapter 5: Grasping the BitBake Tool 6. Chapter 6: Detailing the Temporary Build Directory 7. Chapter 7: Assimilating Packaging Support 8. Chapter 8: Diving into BitBake Metadata 9. Chapter 9: Developing with the Yocto Project 10. Chapter 10: Debugging with the Yocto Project 11. Chapter 11: Exploring External Layers 12. Chapter 12: Creating Custom Layers 13. Chapter 13: Customizing Existing Recipes 14. Chapter 14: Achieving GPL Compliance 15. Chapter 15: Booting Our Custom Embedded Linux 16. Chapter 16: Speeding Up Product Development through Emulation – QEMU 17. Chapter 17: Best Practices 18. Index 19. Other Books You May Enjoy

Building a target image

Poky provides several predesigned image recipes we can use to build our binary image. We can check the list of available images by running the following command from the poky directory:

$ ls meta*/recipes*/*images/*.bb

All the recipes provide images that are a set of unpacked and configured packages, generating a filesystem that we can use with hardware or one of the supported QEMU machines.

Next, we can see the list of most commonly used images:

  • core-image-minimal: This is a small image allowing a device to boot. It is handy for kernel and bootloader tests and development.
  • core-image-base: This console-only image provides basic hardware support for the target device.
  • core-image-weston: This image provides the Wayland protocol libraries and the reference Weston compositor.
  • core-image-x11: This is a basic X11 image with a terminal.
  • core-image-sato: This is an image with Sato support and a mobile environment for mobile devices that use X11. It provides applications such as a terminal, editor, file manager, media player, and so on.
  • core-image-full-cmdline: A console-only image with more full-featured Linux system functionality installed.

There are other reference images available from the community. Several images support features, such as Real Time, initramfs, and MTD (flash tools). It is good to check the source code or the Yocto Project Reference Manual (https://docs.yoctoproject.org/4.0.4/ref-manual/index.html) for the complete and updated list.

The process of building an image for a target is straightforward. But first, we need to set up the build environment using source oe-init-build-env [build-directory] before using BitBake. To build the image, we can use the template in the following command:

Figure 2.3 – How to build a recipe using BitBake

Figure 2.3 – How to build a recipe using BitBake

Note

We will use MACHINE = "qemux86-64" in the following examples. You can set it in build/conf/local.conf accordingly.

For example, to build core-image-full-cmdline, run the following command:

$ bitbake core-image-full-cmdline

The Poky build looks like the following figure:

Figure 2.4 – The result of bitbake core-image-full-cmdline

Figure 2.4 – The result of bitbake core-image-full-cmdline

You have been reading a chapter from
Embedded Linux Development Using Yocto Project - Third Edition
Published in: Apr 2023
Publisher: Packt
ISBN-13: 9781804615065
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 €18.99/month. Cancel anytime