Leon Anavi
IT Tips && Tricks

Mobile & Embedded

Created: 08.03.2025 16:19 Last Modified: 09.03.2025 22:29 Views: 88
Keywords: apt, deb, OpenEmbedded, package-management, PACKAGE_CLASSES, package_deb, Yocto

Runtime Package Management in the Yocto Project with apt and deb Packages

Welcome to Episode 6 of our series on the Yocto Project and OpenEmbedded for Raspberry Pi 5In this installment, we explore runtime package management in core-image-base and Poky, based on the Yocto LTS release Scarthgap.

Overview of Runtime Package Management in Yocto

In the Yocto Project and OpenEmbedded, runtime package management can be configured to support multiple package formats, including ipk, rpm, deb, and tar, regardless of the target hardware. For this demonstration, we will use deb packages, aligning with the widely adopted Debian and Ubuntu distributions. This choice enables seamless package installation and management using apt, a powerful package manager commonly used in Debian-based systems.

By integrating apt with OpenEmbedded, we can install, upgrade, and remove software efficiently. The deb packaging format simplifies software distribution and dependency handling. However, it is essential to note that runtime package management is not an optimal solution for embedded Linux devices in production. Nevertheless, it can be highly convenient during the development stage.

Enabling Runtime Package Management in Yocto for Raspberry Pi 5

Follow the steps below to enable runtime package management with the Yocto Project and OpenEmbedded on Raspberry Pi 5:

Step 1: Initialize the Build Environment

source oe-init-build-env

Step 2: Enable Runtime Package Management and Switch to deb Packages

Add the following line to conf/local.conf:

PACKAGE_CLASSES = "package_deb"
EXTRA_IMAGE_FEATURES += "package-management"

Step 3: Build the Image

bitbake core-image-base

Step 4: Flash the Image and Boot Raspberry Pi 5

Flash core-image-base onto a microSD card and boot it on Raspberry Pi 5.

Step 5: Build nano Text Editor on the Build PC

bitbake nano

Step 6: Update the Package Index on the Build PC

bitbake package-index

Step 7: Launch a Local HTTP Server on the Build PC

cd tmp/deploy/deb
busybox httpd -p 8000 -f -v

Step 8: Configure the Package Repository on Raspberry Pi 5

Create a file / etc / apt / sources.list.d / local-repo.list and add the following content:

deb [trusted=yes] http://IP:8000/all ./
deb [trusted=yes] http://IP:8000/cortexa76 ./
deb [trusted=yes] http://IP:8000/raspberrypi5 ./

Note: Replace IP with the actual address of the build PC in your local area network (for example 192.168.1.251).

Step 9: Update the Package Repositories on Raspberry Pi 5

apt update

Step 10: Install nano from a deb Package

apt install nano

Alternative: Specifying the Package Feed URI at Build Time

You can specify the package feed URI at build time using the variable PACKAGE_FEED_URIS. Refer to the Yocto Project documentation for more details:

Yocto Project Reference Manual - PACKAGE_FEED_URIS

By following these steps, you can efficiently manage runtime packages on Raspberry Pi 5 while leveraging the flexibility of the Yocto Project and OpenEmbedded. More details are available at the official documentation. Stay tuned for the next episode in our series!



  Home | About | Contact | Disclaimer | Sitemap © 2009-2022 Leon Anavi. All rights reserved.