A lightweight daemon for managing Mender updates on embedded Linux systems via Redis.
Archived. Proof-of-concept update tooling, kept for reference. Production OTA handling lives in update-service.
Part of the Librescoot open-source platform.
SMUT runs on embedded Linux systems (MDB and DBC) and triggers Mender updates via Redis. It handles resumable downloads, checksum verification, and interacts with Mender.
- Redis BLPOP for update requests
- Resumable downloads with retry
- Checksum verification (SHA256)
- Support for file:// URLs for local file installation
- Automatic Mender update install and commit
- Error reporting via Redis
- Cross-compilation for armv7l
- No CGO
- Go 1.16+ (for building)
- Redis server
- Mender update client (
mender-updatein PATH) - Linux (armv7l target)
makemake build-armmake clean buildThe project includes an installer script that handles deployment to both MDB and DBC systems.
- Build the ARM binary:
make build-arm- Run the installer:
./install.sh <target-host> <target>Where:
target-host: The hostname/IP of the MDB systemtarget: One of:mdb: Install only on MDBdbc: Install only on DBCboth: Install on both MDB and DBC
The installer handles:
- Copying files to target systems
- Service installation and configuration
- GPIO management for DBC communication
- Service startup and verification
--redis-addr: Redis server address (default: "localhost:6379")--update-key: Redis key for update URLs (default: "mender/update/url")--checksum-key: Redis key for checksums (default: "mender/update/checksum")--failure-key: Redis key to set on failure (default: "mender/update/last-failure")--download-dir: Directory to store downloaded update files (default: "/tmp")--update-type: Type of update ('blocking' for DBC, 'non-blocking' for MDB) (default: "non-blocking")
SMUT uses the ota Redis hash to report status and update type. The status field indicates the current state, and the update-type field indicates if the update is blocking or non-blocking.
To trigger an update, push the URL to the update key using LPUSH:
# For MDB system with remote file
redis-cli LPUSH mender/update/mdb/url "http://example.com/path/to/update.mender"
# For DBC system with remote file
redis-cli LPUSH mender/update/dbc/url "http://example.com/path/to/update.mender"
# For MDB system with local file
redis-cli LPUSH mender/update/mdb/url "file:///path/to/local/update.mender"
# For DBC system with local file
redis-cli LPUSH mender/update/dbc/url "file:///path/to/local/update.mender"When using file:// URLs, SMUT will skip the download step and directly use the specified local file for installation. The file path must be absolute and accessible to the SMUT process.
To set a checksum (optional):
# For MDB system
redis-cli SET mender/update/mdb/checksum "sha256:abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
# For DBC system
redis-cli SET mender/update/dbc/checksum "sha256:abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"The checksum is optional. If provided, it should be in the format algorithm:hash. Currently, only SHA256 is supported.
Errors are reported by setting the configured failure key in Redis with the error message as a string. The status field in the ota hash will also be updated to reflect the error state.
When running as a systemd service, logs can be viewed with:
journalctl -u smut@<system> -fReplace <system> with mdb or dbc.
Check the service status with:
systemctl status smut@<system>Replace <system> with mdb or dbc.