Building Weston for Debian 10

Debian 10 already contains a version of weston but it does not run on our trizeps modules. The version of weston generated by Yocto on the other hand runs without any problems. The reason is that NXP provides modified versions of weston and some libraries. This is a way to make them run on Debian 10

Building Debian packages with Yocto

In the default configuration, bitbake will create RPM packages. The first thing to do is make bitbake to create DEB packages. Edit your <build-dir>/conf/local-conf and change

PACKAGE_CLASSES ?= "package_rpm"

to

PACKAGE_CLASSES ?= "package_deb"

After baking your image the Debian packages can be found in <build-dir>/tmp/deploy/deb.

There will be subdirectories for architecture independent, architecture dependent and more or less machine specific packages.

$ cd <build-dir>/tmp/deploy/deb $ ls -l total 632 drwxr-xr-x 2 imx8 imx8 425984 Aug 11 14:27 aarch64 drwxr-xr-x 2 imx8 imx8 106496 Aug 11 14:37 aarch64-mx8mm drwxr-xr-x 2 imx8 imx8 45056 Aug 11 14:27 all drwxr-xr-x 2 imx8 imx8 49152 Aug 11 14:37 imx8mm_trizeps8mini

Each of these subdirectories will also contain the files Packages, Packages.gz and Release. The file Packages contains information about the packages in the directory, Packages.gz is the same file gzipped and Release contains sizes and checksums of the files Packages, Packages.gz and Release.

The file Packages can also be created by hand with

Package names, dependencies and other nightmares

The Yocto-recipe for weston depends on cairo. There is no package cairo on Debian but a package libcairo2. Installing cairo from yocto will conflict with the already installed libcairo2. The same problem occurs with pango. Weston also depends on libglib-2 with conflicts with the already installed Debian package libglib2. Also the Yocto package libz1 collides with the Debian package zlib1g (both version 1.2.11). Similar problems occur with xkeyboard-config and liberation-fonts which depend on fontconfig.

The weston recipe inherits the Yocto-class useradd which breaks the user-management of Debian. Since there is nothing like uninherit to remove an inheritance there is an own version of the recipe called weston_5.0.0.kuk. This one only depends on packages than are needed by the linker. To replace weston with our own version there is a bbappend-file for the image-recipe containing the line:

The bbappend-file also adds some useful tools to the image like package management and man and also a version of chromium that makes use of wayland.

The Debian package management does not like _ in package names because _ is used to separate the name from the version. For this there is also a bbappend-file for the kernel that changes the name:

Deployment of the Debian packages

Copy the files to a USB-stick

Authenticate Repositories

For security reasons the repositories should be authenticated with gpg (GNU Privacy Guard). To do so you have to create a key:

In the dialog you can choose the type of the key and how long it will be valid. At least give it a name. View the generated key:

The key must be shipped together with the signed repositories. For this you have to export it to a file:

where <keyname> is the hexadecimal number shown by gpg –list-keys.

Now you can authenticate your repositories by creating a signed InRelease-file for each Release-file:

Adding the repository to the package management

To install packages from your repository it must be known by the package management of your target machine. This is done by adding it to the sources.list of the machine. Login to your target machine as root (or sudo) and mount the USB-stick. With your favourite editor create a file /etc/apt/sources.list.d/<name-of-your-choice>.list (as root) with the following contents:

Add the key to your package management:

Now you can update the information in /var/lib/apt and /var/cache/apt:

Installation of the packages

When packages are installed with apt install <package> any dependencies are automatically installed recursively. When a package exists in multiple versions the one with the highest version number is installed. Because this is not always what we want we have to install the packages one by one in the correct order:

Because there is also a package called weston in Debian we have to force the installation of our weston by appending the version number:

The version number of the already install libcairo is slightly higher than that one weston is linked against. Nevertheless it lacks the symbols weston needs. Because replacing the newer Debian version with the older Yocto version will break package dependencies, apt will not allow to do so. We have to do it directly with dpkg:
Warning: From now on no Debian-program that uses libcairo2 can run. The only way to make them runnable again is to reinstall the Debian version of libcairo2 which in turn means that weston will no longer be runnable.

Prebuild Images

Date

Description

Download

Date

Description

Download

13.08.2021

Debian 10.3 (buster) with Yocto-buid weston and chromium

debian-10.3-weston-trizeps8mini-pconxs_v2-variable-atm-svga-ov5640-2021-08-13.imz