Skip to content

Adding Packages to the Yocto Build

General

Packages and package groups can be added to image recipes. See the Yocto Development manual for how to customize an image: https://docs.yoctoproject.org/dev-manual/customizing-images.html#customizing-images-using-custom-image-features-and-extra-image-features

Adding a package to the local build of the BSP

Search for the corresponding recipe and which layer the recipe is in. This link is a useful tool for doing so: http://layers.openembedded.org/layerindex/branch/morty/layers/

If the package is in the meta-openembedded layer, the recipe is already available in your build tree.

Add the following line to YOCTO_DIR/BUILD_DIR/conf/local.conf:

IMAGE_INSTALL:append = " <package>"

Note: The leading whitespace between the " and the package name is necessary for the append command.

If you need to add a layer to the BSP, clone or extract it to the YOCTO_DIR/sources/ directory. Then, modify YOCTO_DIR/BUILD_DIR/conf/bblayers.conf to include this new layer in BBLAYERS:

BBLAYERS += "${BSPDIR}/sources/<new_layer>"

Web server support

Recipes in meta-openembedded/meta-webserver/recipes-httpd:

  • apache2
  • cherokee
  • hiawatha
  • monkey
  • nginx
  • nostromo
  • sthttpd

Recipes in poky/meta/recipes-extended/lighttpd:

  • lighttpd

Although full of capabilities and features, Apache is commonly considered quite heavy, so is not generally used for embedded devices. Nostromo and sthttpd are commonly considered ultralight web servers, with a very small set of capabilities and features, with very limited resource requirements.

The usual choice is between the following 5:

  • cherokee
  • hiawatha
  • monkey
  • nginx
  • lighttpd

Here you can find an article comparing the above 5 web servers: https://www.linux.com/news/which-light-weight-open-source-web-server-right-you

Accelerated browsers support

The Yocto build system allows integrating browsers that support i.MX GPU acceleration.

The commonly used browsers are:

  • QtWebKit-based browsers: QtWebKit is the WebKit port to Qt. WebKit is an open-source web browser engine. Qt5 provides some demo implementations in webkitwidgets examples. Qt6 does not support QtWebKit.
  • QtWebEngine-based browsers: QtWebEngine integrates Chromium's fast-moving web capabilities into Qt. Both Qt5 and Qt6 provide some demo implementations in webenginewidgets examples.
  • Chromium-based browsers: Chromium is an open-source browser project.

Until 2016, the FSLC community maintained the chromium-imx project: customized Chromium versions (up to v48) providing GPU and VPU integration for i.MX CPUs.

More up-to-date Chromium versions are available from meta-browser, which only provides GPU integration.

The minimum requirement to use Chromium browsers is X11 or Wayland.

Qt-based browsers directly rely on Qt integration with i.MX acceleration.

QtWebKit has been superseded by QtWebEngine, mainly because QtWebKit has not been actively synchronized with the upstream WebKit code since Qt 5.2, it has been deprecated in Qt 5.5 and completely removed from Qt6 releases. Further details are available in the Qt WebEngine Overview

For Qt5 only, the Qt team provides a QtWebEngine browser for embedded touch devices, and related recipes have been integrated into our BSP starting from Sumo.

The performance of each browser is strictly related to the features to be used, so different HTML applications can provide better performance with different browsers.

Add QtWebKit examples to the build (Qt5 only)

Add the following line to YOCTO_DIR/BUILD_DIR/conf/local.conf:

IMAGE_INSTALL:append = " qtwebkit-examples-examples"

Add QtWebEngine examples to the build (both Qt5 and Qt6)

Add the following line to YOCTO_DIR/BUILD_DIR/conf/local.conf:

IMAGE_INSTALL:append = " qtwebengine-examples"

For Qt6, the following may also be required:

PACKAGECONFIG:append:pn-qtwebengine = " examples"

Add Chromium to the build

Chromium support is provided by the third-party layer meta-browser.

Due to the lack of dedicated integrations with i.MX SoCs, this layer is no longer part of our latest manifests. Also, be aware that the branch/commit should match your current BSP version, but not all the branches are available from meta-browser layer: for example, there is currently no Dunfell branch.

Before proceeding, double-check that the meta-browser layer is actually listed in the YOCTO_DIR/BUILD_DIR/conf/bblayers.conf file.

If missing, ensure to have downloaded the meta-browser layer in YOCTO_DIR/sources folder and to add it to the list in the YOCTO_DIR/BUILD_DIR/conf/bblayers.conf file.

To build chromium, you can add the following line to YOCTO_DIR/BUILD_DIR/conf/local.conf:

IMAGE_INSTALL:append = " chromium<suffix>"
LICENSE_FLAGS_WHITELIST += "commercial_libav commercial_x264"

The depends on your specific Yocto version and graphic backend.

Until Yocto Morty, Chromium was available only for the X11 backend and no suffix was required:

IMAGE_INSTALL:append = " chromium"

Starting from Yocto Thud, Chromium is available for both the X11 backend

IMAGE_INSTALL:append = " chromium-x11"

And the Wayland backend:

IMAGE_INSTALL:append = " chromium-ozone-wayland"

If you plan to use Chromium, please take care of the specific requirements for commercial license of libav and x264 packages.

Also, starting from March 2021, in the master branch, the layer structure has been reorganized with the commit chromium, firefox: split layer into meta-chromium and meta-firefox.

Building chromium from a meta-layer version before this commit, the expected change in the bblayers.conf file is:

BBLAYERS += "${BSPDIR}/sources/meta-browser"

While after this commit, the expected change in the bblayers.conf file is:

BBLAYERS += "${BSPDIR}/sources/meta-browser/meta-chromium"

The demo browser used for the above tests is available as:

/usr/bin/google-chrome