How to Create Yocto Projects
Create a Basic Project
On this section we will unify all the information provided about Yocto to create a simple project. First, we will generated a Yocto image, then we will create out own first meta-layer. If you have extra question feel free to
Setting Enviroment
- Install Dependencies
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping
- Create the Yocto project directory
mkdir yocto-first-project cd yocto-first-project
- Get Poky source code
git clone -b dunfell git://git.yoctoproject.org/poky.git poky cd poky
- Run Yocto enviroment script.
source oe-init-build-env
Create a custom meta-layer
- Create the meta-rr. Yocto provides a command to create your own meta-layers
bitbake-layers create-layer meta-rr
- Run the following command to include meta-rr into the project meta-layers.
bitbake-layers add-layer meta-rr
- Check meta-rr is active
bitbake-layers show-layers
Create the Source Code
- Create the a directory for the new recipe.
mkdir -p meta-rr/recipes-example/rrrecipe/files
- With your favorite text editor create my_first_recipe.c into the directory previously created and include the following content.
#include <stdio.h> int main() { printf("RidgeRun LLC. \n"); printf("Embedded Solutions. \n"); return 0; }
Create the recipe
- Run the following command to create the recipe file.
touch meta-rr/recipes-example/rrrecipe/rr_recipe.bb
- With your favorite text editor include the following content.