Adding Debian packages

From Variscite Wiki
Revision as of 15:02, 22 April 2023 by Alex (talk | contribs) (Adding packages to rootfs: add 'adding packages at runtime')
DART-MX8M-MINI - Adding Debian Packages

General

It's not recommended to duplicate SOM's internal storage/clone from one device to another. There are 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 tarball at ~/var_mx8mm_dart_debian_buster/output/rootfs.tar.gz, ready to be deployable for other targets.

Adding packages to rootfs

If you want to add more packages to Debian, you can install them at runtime or compile time. In this example, we will add the packages git and vim.

  • Add required packages at runtime

Assuming you've already your target up and running (by using your own Debian built or a Recovery SD card), login to the target and run:

# apt-get update && apt-get -y upgrade
# apt-get -y install git vim
  • Add required packages at compile time

Add your list of packages to the build script, by using the build script variable 'G_USER_PACKAGES'.

For example:

#### user rootfs packages ####
readonly G_USER_PACKAGES=" \
	git \
	vim \
	"

File: ~/var_mx8mm_dart_debian_buster/var_make_debian.sh

and build the rootfs, according to the Debian Build Release guide.

Adding application to rootfs

If you have your application to be installed on your rootfs:
Take https://github.com/varigit/debian-var/blob/debian_buster_var01/variscite/weston_rootfs.sh#L295
lines as an example and install your applications, config files / settings etc.
Don't forget to copy your resources to variscite folder.

Build the rootfs

Please refer to the Debian Build Release guide to learn how to use the build script to create a rootfs.