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

Knowing the local.conf file

When we initialize a build environment, it creates a file called build/conf/local.conf. This config file is powerful, since it can configure almost every aspect of the build process. We can set the target machine and the toolchain host architecture to be used for a custom cross-toolchain, optimize options for maximum build time reduction, and so on. The comments inside the build/conf/local.conf file are excellent documentation and a reference of the possible variables and their defaults. The minimal set of variables that we probably want to change from the default is the following:

MACHINE ??= "qemux86-64"

The MACHINE variable is where we determine the target machine we wish to build. At the time of writing, Poky supports the following machines in its reference BSP:

  • beaglebone-yocto: This is BeagleBone, which is the reference platform for 32-bit ARM
  • genericx86: This is generic support for 32-bit x86-based machines
  • genericx86-64: This is generic support for 64-bit x86-based machines
  • edgerouter: This is EdgeRouter Lite, which is the reference platform for 64-bit MIPS

The machines are made available by a layer called meta-yocto-bsp. Besides these machines, OpenEmbedded Core, inside the meta directory, also provides support for the following Quick Emulation (QEMU) machines:

  • qemuarm: This is the QEMU ARMv7 emulation
  • qemuarmv5: This is the QEMU ARMv5 emulation
  • qemuarm64: This is the QEMU ARMv8 emulation
  • qemumips: This is the QEMU MIPS emulation
  • qemumips64: This is the QEMU MIPS64 emulation
  • qemuppc: This is the QEMU PowerPC emulation
  • qemuppc64: This is the QEMU PowerPC 64 emulation
  • qemux86-64: This is the QEMU x86-64 emulation
  • qemux86: This is the QEMU x86 emulation
  • qemuriscv32: This is the QEMU RISC-V 32 emulation
  • qemuriscv64: This is the QEMU RISC-V 64 emulation

Extra BSP layers available from several vendors provide support for other machines. The process of using an extra BSP layer is shown in Chapter 11, Exploring External Layers.

Note

The local.conf file is a convenient way to override several global default configurations throughout the Yocto Project’s tools. Essentially, we can change or set any variable – for example, adding additional packages to an image file. Changing the build/conf/local.conf file is convenient; however, the source code management system usually does not track temporary changes in this directory.

The build/conf/local.conf file can set several variables. It is worth taking some time and reading through the file comments that are generated to get a general idea of what variables can be set.

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