Changing DISTRO_FEATURES - FrankBau/meta-marsboard-bsp GitHub Wiki

Distro = short for Linux Distribution. A distro consists of a Linux kernel plus a larger number of well maintained packages from which images (= kernel + bootable root file system with user mode progs) are built.

DISTRO_FEATURES do not only apply to a single image, but to all packages built. Many packages depend on particular distro features like, for example a GUI built on a windowing system: If you are planning a distro with a GUI based on the X11 windowing system, many packages (like gstreamer) must know that already when they are configured. This implies: after changing distro features, a clean build is needed.

The variable DISTRO_FEATURES is typically set or modified in the build/conf/local.conf file.

Lets assume that your build/conf/local.conf file contained a line

DISTRO_FEATURES_remove = "x11 wayland"

and you already have built an image for a headless (==no GUI) system with this configuration. Now, you want to change that and add X11. You do not want to delete the whole bitbake folder structure. Instead you want to reuse at least the download folder containing the downloaded sources.

  1. Create a new empty folder build_X11 parallel to the existing build folder

  2. Copy the conf subfolder of build into the new folder build_X11

  3. Edit build_X11/conf/local.conf to your needs, e.g. change the above line to

    DISTRO_FEATURES_append = "x11"

Open a bitbake shell for the existing top-level folder like you did before, but use the new build folder:

$ source setup-environment build_X11

Start bitbaking your image

...../build_X11$ bitbake image-multimedia-full-with-opencv

Bitbake will regularly check for free disk space. When you are running low in disk space you may start deleting all stuff from the old build folder. You may keep the old /build/tmp/deploy subfolder for a while to be able to use the old distro until you have successfully tested your new image with the new distro features.

Further Reading