Install_snap - installing a snap package through a Mender Artifact

Description

The install_snap Update Module is able install packages to the device running Mender using the snap tooling.

Example use-cases:

  • managing devices running the snap app store, specifically Ubuntu

Specification

Specification
Module name install_snap
Supports rollback no
Requires reboot no
Artifact generation .script yes
Full operating system updater no
Source code GitHub
Maintainer josef.holzmayr@northern.tech

Please be aware that Mender Update modules are meant to update parts of the operating system and if not configured properly they could potentially delete parts or even the full operating system. Always inspect the code carefully and only test modules on device that you can recover easily.

It is not recommended to install a Mender Artifact on your workstation

Prepare the device

This section describes how to setup your target device, i.e. the device to be updated. This will also be referred to as the device environment.

All commands outlined in this section should be run in the device environment.

Prerequisites

This update module has the following prerequisites for the device environment:

Install the Update Module

Download the latest version of this Update Module by running:

mkdir -p /usr/share/mender/modules/v3 && wget -P /usr/share/mender/modules/v3 https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/install_snap/module/install_snap && chmod +x /usr/share/mender/modules/v3/install_snap

Prepare the development environment on your workstation

This section describes how to set up your development environment on your workstation.

All commands outlined in this section should be run in the development environment.

Prerequisites

This Update Modules has the following prerequisites for the development environment:

Create Mender Artifacts

To download install_snap-artifact-gen, run the following:


wget https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/install_snap/module-artifact-gen/install_snap-artifact-gen && chmod +x install_snap-artifact-gen

Generate Mender Artifacts using the following command:

ARTIFACT_NAME="my-update-1.0"
DEVICE_TYPE="my-device-type"
./install_snap-artifact-gen \
--artifact-name ${ARTIFACT_NAME} \
--device-type ${DEVICE_TYPE} \
<name of snap> ...

An example to create an artifact installing the hello-world snap package on a raspberrypi4 machine could be:

ARTIFACT_NAME="hello-world-1.0"
DEVICE_TYPE="raspberrpi4"
./install_snap-artifact-gen \
--artifact-name ${ARTIFACT_NAME} \
--device-type ${DEVICE_TYPE} \
hello-world

You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments.

Artifact technical details

This is a use case of an artifact exclusively using meta data as its payload. Find more on the concept in this article.