Uploaded March 2025 | Updated September 2026, 2 weeks ago
This is episode 7 of our series on the Yocto Project and OpenEmbedded for Raspberry Pi 5, where we will discuss how to create a new layer, how to create a new recipe and how to extend an existing recipe using .bbappend file. All examples are based on the Yocto LTS release Scarthgap.
* Initialize the build environment:
source oe-init-build-env
* Create a new layer:
bitbake-layers create-layer ../meta-leon
* Add the new layer to conf/bblayers.conf:
bitbake-layers add-layer ../meta-leon
* Open another terminal and enter the layer created on the previous step:
cd meta-leon
* Create a directory for the "Hello, World" recipe:
mkdir -p recipes-apps/hello/
* Create recipe recipes-apps/hello/hello_git.bb with the following content:
DESCRIPTION = "Hello World"
HOMEPAGE = "github.com/leon-anavi/hello-world"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f388cad0df1af35e3626518d587c0cb6"
SRC_URI = "git://github.com/leon-anavi/hello-world.git;branch=master;protocol=https"
SRCREV = "f66f58e7bcdcc834568d8c7c6fc51e30765befad"
S = "${WORKDIR}/git"
inherit autotools
* Create a directory in the layer to extend core-image-base:
mkdir -p recipes-core/images/
* Create file recipes-core/images/core-image-base.bbappend and add in it the following line to install the hello recipe from layer meta-leon to core-image-base:
IMAGE_INSTALL:append = " hello"
* Go back to the terminal where the build environment has been initialized and build the new image:
bitbake core-image-base
* Flash core-image-base-raspberrypi5.rootfs.wic.bz2 to a microSD card
* Boot Raspberry Pi 5 from the microSD card and execute hello to verify that the "Hello, World" application has been successfully built and included in the image.
π Related Videos
===
Episode 1: The Yocto Project on Raspberry Pi 5: Building an Embedded GNU Linux Distribution
youtu.be/fY7u6PiV8qA?si=-DgvkJ_yTsiX05vx
Episode 2: SSH for Remote Network Access
youtu.be/ltckiBV9FXg?si=DJwsKLDhHkDIqCIn
Episode 3: Running Docker Containers
youtu.be/kQnOidK_U3M?si=5KiS1FK87OwfdQ0m
Episode 4: U-Boot Bootloader
youtu.be/9tohomiv1Ug?si=QydN1yPRJzY6zEfz
Episode 5: Modifying U-Boot Environment in Linux with fw_setenv
youtu.be/SB5NvIF1IEU?si=gW02HUr-0cfdyQLL
Episode 6: Runtime Package Management with apt and deb Packages
youtu.be/6i5UtF7fiaA?si=3n1hRSEaSfe5a92N
π Useful Links
===
yoctoproject.org
docs.yoctoproject.org
openembedded.org/wiki/Main_Page
This is episode 7 of our series on the Yocto Project and OpenEmbedded for Raspberry Pi 5, where we will discuss how to create a new layer, how to create a new recipe and how to extend an existing recipe using .bbappend file. All examples are based on the Yocto LTS release Scarthgap.
* Initialize the build environment:
source oe-init-build-env
* Create a new layer:
bitbake-layers create-layer ../meta-leon
* Add the new layer to conf/bblayers.conf:
bitbake-layers add-layer ../meta-leon
* Open another terminal and enter the layer created on the previous step:
cd meta-leon
* Create a directory for the "Hello, World" recipe:
mkdir -p recipes-apps/hello/
* Create recipe recipes-apps/hello/hello_git.bb with the following content:
DESCRIPTION = "Hello World"
HOMEPAGE = "github.com/leon-anavi/hello-world"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f388cad0df1af35e3626518d587c0cb6"
SRC_URI = "git://github.com/leon-anavi/hello-world.git;branch=master;protocol=https"
SRCREV = "f66f58e7bcdcc834568d8c7c6fc51e30765befad"
S = "${WORKDIR}/git"
inherit autotools
* Create a directory in the layer to extend core-image-base:
mkdir -p recipes-core/images/
* Create file recipes-core/images/core-image-base.bbappend and add in it the following line to install the hello recipe from layer meta-leon to core-image-base:
IMAGE_INSTALL:append = " hello"
* Go back to the terminal where the build environment has been initialized and build the new image:
bitbake core-image-base
* Flash core-image-base-raspberrypi5.rootfs.wic.bz2 to a microSD card
* Boot Raspberry Pi 5 from the microSD card and execute hello to verify that the "Hello, World" application has been successfully built and included in the image.
π Related Videos
===
Episode 1: The Yocto Project on Raspberry Pi 5: Building an Embedded GNU Linux Distribution
youtu.be/fY7u6PiV8qA?si=-DgvkJ_yTsiX05vx
Episode 2: SSH for Remote Network Access
youtu.be/ltckiBV9FXg?si=DJwsKLDhHkDIqCIn
Episode 3: Running Docker Containers
youtu.be/kQnOidK_U3M?si=5KiS1FK87OwfdQ0m
Episode 4: U-Boot Bootloader
youtu.be/9tohomiv1Ug?si=QydN1yPRJzY6zEfz
Episode 5: Modifying U-Boot Environment in Linux with fw_setenv
youtu.be/SB5NvIF1IEU?si=gW02HUr-0cfdyQLL
Episode 6: Runtime Package Management with apt and deb Packages
youtu.be/6i5UtF7fiaA?si=3n1hRSEaSfe5a92N
π Useful Links
===
yoctoproject.org
docs.yoctoproject.org
openembedded.org/wiki/Main_Page










