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 ARMgenericx86
: This is generic support for 32-bit x86-based machinesgenericx86-64:
This is generic support for 64-bit x86-based machinesedgerouter
: 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 emulationqemuarmv5
: This is the QEMU ARMv5 emulationqemuarm64
: This is the QEMU ARMv8 emulationqemumips
: This is the QEMU MIPS emulationqemumips64
: This is the QEMU MIPS64 emulationqemuppc
: This is the QEMU PowerPC emulationqemuppc64
: This is the QEMU PowerPC 64 emulationqemux86-64
: This is the QEMU x86-64 emulationqemux86
: This is the QEMU x86 emulationqemuriscv32
: This is the QEMU RISC-V 32 emulationqemuriscv64
: 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.