Build Yocto Project Step By Step
Yocto Project Build For Linux
Last updated
Yocto Project Build For Linux
Last updated
You should be familiar with the Yocto tools and the concept of recipes. For more information, see Yocto Project documentation.
Please make sure your host PC is running Ubuntu 18.04/20.04 64-bit and install the following packages:
The Build Host PackagesΒΆ
Required build host packages vary depending on your build machine and what you want to do with the Yocto Project. For example, if you want to build an image that can run on QEMU in graphical mode (a minimal, basic build requirement), then the build host package requirements are different than if you want to build an image on a headless system or build out the Yocto Project documentation set.
Collectively, the number of required packages is large if you want to be able to cover all cases.
In general, you need to have root access and then install the required packages. Thus, the commands in the following section may or may not work depending on whether or not your Linux distribution has sudo
installed.
The following list shows the required packages needed to build an image that runs on QEMU in graphical mode (e.g. essential plus graphics support). For lists of required packages for other scenarios, see the "Required Packages for the Host Development System" section in the Yocto Project Reference Manual.
Ubuntu and Debian
Fedora
OpenSUSE
CentOS
Extra Packages for Enterprise Linux (i.e. epel-release
) is a collection of packages from Fedora built on RHEL/CentOS for easy installation of packages not included in enterprise Linux by default. You need to install these packages separately.
The makecache
command consumes additional Metadata from epel-release
.
Once you complete the setup instructions for your machine, you need to get a copy of the poky
repository on your build host. Continue with the "Yocto Project Release" section.
Now that your build host has the right packages (native Linux machine) or you have the Poky container set up (CROPS), you need to get a copy of the Yocto Project. It is recommended that you get the latest Yocto Project release by setting up (cloning in Git terms) a local copy of the poky
Git repository on your build host and then checking out the latest release. Doing so allows you to easily update to newer Yocto Project releases as well as contribute back to the Yocto Project.
Here is an example from a native Linux machine that is running Ubuntu.
If your build host is using a Poky container, you can use the same Git commands.
The following example clones the poky
repository and then checks out the latest Yocto Project Release by tag (i.e. yocto-2.4.2
):
The previous Git checkout
command creates a local branch named poky_2.4.2
. The files available to you in that branch exactly match the repository's files in the rocko
development branch at the time of the Yocto Project 2.4.2 release.
Rather than checking out the entire development branch of a release (i.e. the tip), which could be continuously changing while you are doing your development, you would check out a branch based on a release tag as shown in the previous example. Doing so provides you with an unchanging, stable set of files.
For more options and information about accessing Yocto Project related repositories, see the "Working With Yocto Project Source Files" section in the Yocto Project Development Tasks Manual.
go to current directory of poky
add the environment variable
source poky/oe-init-build-env
After compile successfully you can find the image
../build/tmp/deploy/images/qemux86-64/
qemux86-64 this is default device image you can also set /build/conf/local.conf file...
MACHINE ??="qemux86-64"
then save and recompile ..