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:
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:
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¶
- Generate a Debian package and publish it to an apt server.
- Add the package to the package list as described above.
- Add your apt server address to the mirrors section of
debian_desktop_arm32.yamlin:
FlexBuild Application Makefile¶
Create a .mk file under:
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:
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.