Adding Debian packages: Difference between revisions

From Variscite Wiki
(Adding packages to rootfs: add note for Debian packages directory)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- Set release according to "release" parameter in URL and use MORTY_V1.0_DART-6UL as default
<!-- Set release according to "release" parameter in URL and use RELEASE_BUSTER_V1.0_DART-MX8M-MINI as default
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{INIT_RELEASE_PARAM|RELEASE_BUSTER_V1.0_DART-MX8M-MINI}} <!--
--> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_BUSTER_V1.0_DART-MX8M-MINI}}}} <!--
--> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#vardefine:RELEASE_BUILD_GUIDE|{{#varexists:META_VARISCITE_DEBIAN|Yocto_Debian_Build_Release|Debian_Build_Release}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Adding Debian Packages}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Debian}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Adding Debian Packages}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Debian}} __toc__
= General =
= 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:BUILD_FOLDER}}/output/rootfs.tar.gz, ready to be deployable for other targets.
It's not recommended to duplicate/clone SOM's internal storage from one device and attach it 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 an archive, ready to be deployable for other targets.  


== Adding packages to rootfs ==
Please refer to the {{Varlink|{{#var:RELEASE_BUILD_GUIDE}}|{{#var:RELEASE_LINK}}|Debian Build Release}} guide to learn more about the build process.
If you want to add more packages to Debian, you can add your list of packages to the build script, by using the build script variable '''G_USER_PACKAGES'''.
 
== Adding packages during build time ==
{{#varexists:META_VARISCITE_DEBIAN
| <!-- Debian build with Yocto -->
Extra Debian packages can be added to the Debian rootfs using the Yocto variable ''APTGET_EXTRA_PACKAGES''. For example, to add the package '''git''' and '''vim''', one can add the following line to the local.conf ({{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_XWAYLAND}}/conf/local.conf):
<pre>
APTGET_EXTRA_PACKAGES:append = " git vim"
</pre>
This will add those packages to the rootfs and, respectively, to the Debian image.
| <!-- Legacy Debian build system -->
If you want to add more packages to the Debian rootfs, add your list of packages to the build script variable ''G_USER_PACKAGES'' (already present in the build script).
 
For example, if you want to add the packages '''git''' and '''vim''', you can change
 
<pre>
#### user rootfs packages ####
readonly G_USER_PACKAGES=""
</pre>
 
to


For example, if you want to add the packages '''git''' and '''vim''':
<pre>
<pre>
#### user rootfs packages ####
#### user rootfs packages ####
Line 17: Line 36:
"
"
</pre>
</pre>
''File: {{#var:BUILD_FOLDER}}/var_make_debian.sh''
''File: {{#var:BUILD_FOLDER}}/var_make_debian.sh''<br>
 
}}
and build the rootfs according to the {{Varlink2|Debian Build Release|{{#var:RELEASE_LINK}}}} guide.<!--
{{Note|'''Note:''' You can look up the available packages for Debian {{#var:DEBIAN_NAME}} at the [https://www.debian.org/distrib/packages.en.html Debian packages directory].|info}}
{{#varexists:META_VARISCITE_DEBIAN||
== Adding application to rootfs ==
If you have your application to be installed on your rootfs, you can add your application files (e.g., binaries, libraries, service and configuration files) to the 'variscite' folder (located in the root of the build folder: {{#var:BUILD_FOLDER}}/variscite) and add the installation routine to the build script.<br><br>
Take the forth-stage section of the following script as an example (search for "# fourth-stage" in the script): https://github.com/varigit/debian-var/blob/debian_buster_var01/variscite/weston_rootfs.sh <br>


-->{{Note|'''Note:''' You can look up the available packages for Debian {{#var:DEBIAN_NAME}} at the [https://www.debian.org/distrib/packages.en.html Debian packages directory].|info}}
In this stage, the build script installs, for example, the service '''variscite-bt''' (search for "# install variscite-bt service") by copying its application files (located at the 'variscite' folder) to their proper places in the rootfs.
 
}}
== Adding application to rootfs ==
If you have your application to be installed on your rootfs: <br>
Take https://github.com/varigit/debian-var/blob/debian_buster_var01/variscite/weston_rootfs.sh#L295 <br>
lines as an example and install your applications, config files / settings etc. <br>
Don't forget to copy your resources to variscite folder.<br>


== Build the rootfs ==
== Build the rootfs ==
Please refer to the {{varlink|Debian_Build_Release|{{#var:RELEASE_PARAM}}|Debian Build Release guide}} to learn how to use the Debian build script to create the rootfs.
{{#varexists:META_VARISCITE_DEBIAN
| <!-- Debian build with Yocto -->
Once you have made the changes one can rebuild the Debian image, including the rootfs. Please refer to the {{varlink|{{#var:RELEASE_BUILD_GUIDE}}|{{#var:RELEASE_PARAM}}|Debian Build Release guide}} to learn how to do it.
| <!-- Legacy Debian build system -->
Please refer to the {{varlink|{{#var:RELEASE_BUILD_GUIDE}}|{{#var:RELEASE_PARAM}}|Debian Build Release guide}} to learn how to use the Debian build script to create the rootfs.
}}

Latest revision as of 18:08, 12 September 2024

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release RELEASE_BUSTER_V1.0_DART-MX8M-MINI.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
DART-MX8M-MINI - Adding Debian Packages

General

It's not recommended to duplicate/clone SOM's internal storage from one device and attach it 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 an archive, ready to be deployable for other targets.

Please refer to the Debian Build Release guide to learn more about the build process.

Adding packages during build time

If you want to add more packages to the Debian rootfs, add your list of packages to the build script variable G_USER_PACKAGES (already present in the build script).

For example, if you want to add the packages git and vim, you can change

#### user rootfs packages ####
readonly G_USER_PACKAGES=""

to

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

File: ~/var_mx8mm_dart_debian_buster/var_make_debian.sh

Note: You can look up the available packages for Debian Buster at the Debian packages directory.

Adding application to rootfs

If you have your application to be installed on your rootfs, you can add your application files (e.g., binaries, libraries, service and configuration files) to the 'variscite' folder (located in the root of the build folder: ~/var_mx8mm_dart_debian_buster/variscite) and add the installation routine to the build script.

Take the forth-stage section of the following script as an example (search for "# fourth-stage" in the script): https://github.com/varigit/debian-var/blob/debian_buster_var01/variscite/weston_rootfs.sh

In this stage, the build script installs, for example, the service variscite-bt (search for "# install variscite-bt service") by copying its application files (located at the 'variscite' folder) to their proper places in the rootfs.

Build the rootfs

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