Skip to content

Adding Packages to the Debian Build

General

It is not recommended to duplicate or clone a SOM's internal storage from one device and attach it to another. A few scripts run on first boot, and configuration files are generated with values unique to the SOM.

A better approach is to add required packages, services, and applications to the Debian rootfs at build time. The rootfs generated by FlexBuild can then be deployed to other targets.

See Build Debian from source code for the build flow.

Requirements

Follow the FlexBuild setup steps in Build Debian from source code.

Adding Packages During Build Time

To add packages to the Debian rootfs, add them to the package list in:

[...]/flexbuild/configs/debian/extra_packages_list_backport

For example, if you are building a desktop image and want to add docker.io and docker-compose, add them to the desktop package list:

extra_desktop_devel_packages_backport=" \
    gpiod \
    libgpiod-dev \
    docker.io \
    docker-compose \
"

You can look up available Debian Bookworm packages in the Debian packages directory.

Adding an Application to the Rootfs

You can add an application to the rootfs using a Debian package or a FlexBuild application Makefile.

Debian Package

  1. Generate a Debian package and publish it to an apt server.
  2. Add the package to the package list as described above.
  3. Add your apt server address to the mirrors section of debian_desktop_arm32.yaml in:
[...]/flexbuild/configs/debian/

FlexBuild Application Makefile

Create a .mk file under:

[...]/flexbuild/src/apps/*/

The Makefile can clone, build, and install your application when FlexBuild builds the rootfs. See imx_test.mk for an example.

See the FlexBuild add new package and board documentation for more information.

Build the Rootfs

Once the FlexBuild environment is ready and you are inside the Docker environment, build the whole image:

var_build_image imx7-var-som debian:desktop "uboot linux"

Or build the rootfs stages individually:

bld rfs -r debian:desktop -f sdk-var.yml -m imx7-var-som
bld apps -r debian:desktop -f sdk-var.yml -m imx7-var-som
bld merge-apps -r debian:desktop -f sdk-var.yml -m imx7-var-som
bld merge-bootpart-rfs -r debian:desktop -f sdk-var.yml -m imx7-var-som

See the FlexBuild usage documentation for more information.