Adding Packages to the Debian Build¶
General¶
It's not recommended to duplicate or clone a SOM's internal storage from one device and attach it to another. A few scripts run for the first time at startup, and configuration files are generated, which are unique to the SOM. A better approach is to add required packages, services, and applications to the Debian rootfs at compile time using the build script. The resulting rootfs, created by the build script, will then be available as an archive, ready to be deployable for other targets.
Please refer to the Debian Build Release guide to learn more about the build process.
Requirements¶
Follow steps 3-6 from Debian Build Release guide to make sure the Flexbuild environment is properly set.
Adding packages during build time¶
If you want to add more packages to the Debian rootfs, add them to the list of packages file called extra_packages_list_backport. The file is on '[...]/flexbuild/configs/debian/'.
For example, if you're building a desktop image and you want to add the packages docker.io and docker-compose, you can change
to
extra_desktop_devel_packages_backport=" \
gpiod \
libgpiod-dev \
.
.
.
docker.io \
docker-compose \
"
File: [...]/flexbuild/configs/debian/
Note: You can look up the available packages for Debian Bookworm at the Debian packages directory.
Adding application to rootfs¶
If you have your application to be installed on your rootfs, you can do it in two different ways. The first is through a Debian package, and the second is through a Makefile.
The Debian package way:
- Generate a Debian Package and publish it to an apt server. Consider the var-mii and the ti-debian-repos projects as examples.
- Once the package is ready and available for downloads, add it to the list of packages as explained in step 1.1 of this guide.
- Now, include your apt server address on the mirrors section of debian_desktop_arm64.yaml file. That file is on [...]/flexbuild/configs/debian/ directory.
The Makefile way:
All you have to do is create a '.mk' file on [...]/flexbuild/src/apps/*/ directory. The Makefile will clone, build, and install your application when you start building the package/image. See the example of imx_test.mk.
Refer to the add new package and board documentation for more information.
Build the rootfs¶
To build the rootfs itself, you can build the whole image with var_build_image command, or you can build the rootfs individually. In both cases, you should have the Flexbuild prepared and you should be in the Docker environment.
Once you have all set, choose one of the following ways to build the root file system.
Building the whole image:
Building the rootfs individually:
[root@fbdebian flexbuild]$ bld merge-bootpart-rfs -r debian:desktop -f sdk-var.yml -m imx95-var-dart
Please refer to the usage documentation for more information.