The Yocto Project on Raspberry Pi 5 Episode 7: Create a New Layer, a New Recipe (.bb) and .bbappend
Автор: Leon Anavi
Загружено: 15 мар. 2025 г.
Просмотров: 750 просмотров
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 = "https://github.com/leon-anavi/hello-w..."
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
• The Yocto Project on Raspberry Pi 5 E...
Episode 2: SSH for Remote Network Access
• The Yocto Project on Raspberry Pi 5 E...
Episode 3: Running Docker Containers
• The Yocto Project on Raspberry Pi 5 E...
Episode 4: U-Boot Bootloader
• The Yocto Project on Raspberry Pi 5 E...
Episode 5: Modifying U-Boot Environment in Linux with fw_setenv
• The Yocto Project on Raspberry Pi 5 E...
Episode 6: Runtime Package Management with apt and deb Packages
• The Yocto Project on Raspberry Pi 5 E...
📚 Useful Links
===
https://www.yoctoproject.org/
https://docs.yoctoproject.org/
https://www.openembedded.org/wiki/Mai...

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: