From 4f183a0dd8dcaed97ff704e698fdbe57c6b6b2d2 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 17 May 2019 12:22:23 +0200 Subject: aktualizr-polling-interval: new config fragment. Can be used for testing purposes after we increase the default polling interval in aktualizr. We no longer recommend anything less than an hour for production use cases, but it's still convenient to poll more frequently while testing. Signed-off-by: Patrick Vacek --- README.adoc | 1 + recipes-sota/config/aktualizr-polling-interval.bb | 29 ++++++++++++++++++++++ recipes-sota/config/files/60-polling-interval.toml | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 recipes-sota/config/aktualizr-polling-interval.bb create mode 100644 recipes-sota/config/files/60-polling-interval.toml diff --git a/README.adoc b/README.adoc index 1ca2bdd..7e6fb43 100644 --- a/README.adoc +++ b/README.adoc @@ -92,6 +92,7 @@ Your images will also need network connectivity to be able to reach an actual OT * `SOTA_SECONDARY_CONFIG_DIR` - a directory containing JSON configuration files for virtual secondaries on the host. These will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr. * `SOTA_HARDWARE_ID` - a custom hardware ID that will be written to the aktualizr config. Defaults to MACHINE if not set. * `RESOURCE_xxx_pn-aktualizr` - controls maximum resource usage of the aktualizr service, when `aktualizr-resource-control` is installed on the image. See <> for details. +* `SOTA_POLLING_SEC` - sets polling interval for aktualizr to check for updates if aktualizr-polling-sec is included in the image. == Usage diff --git a/recipes-sota/config/aktualizr-polling-interval.bb b/recipes-sota/config/aktualizr-polling-interval.bb new file mode 100644 index 0000000..53c008a --- /dev/null +++ b/recipes-sota/config/aktualizr-polling-interval.bb @@ -0,0 +1,29 @@ +SUMMARY = "Set polling interval in Aktualizr" +DESCRIPTION = "Configures aktualizr to poll at a custom frequency (suitable for testing or other purposes)" +HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" +SECTION = "base" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" + +inherit allarch + +SRC_URI = " \ + file://60-polling-interval.toml \ + " + +SOTA_POLLING_SEC ?= "30" + +do_install_append () { + install -m 0700 -d ${D}${libdir}/sota/conf.d + install -m 0644 ${WORKDIR}/60-polling-interval.toml ${D}${libdir}/sota/conf.d/60-polling-interval.toml + + sed -i -e 's|@POLLING_SEC@|${SOTA_POLLING_SEC}|g' \ + ${D}${libdir}/sota/conf.d/60-polling-interval.toml +} + +FILES_${PN} = " \ + ${libdir}/sota/conf.d/60-polling-interval.toml \ + " + +# vim:set ts=4 sw=4 sts=4 expandtab: + diff --git a/recipes-sota/config/files/60-polling-interval.toml b/recipes-sota/config/files/60-polling-interval.toml new file mode 100644 index 0000000..7d25d05 --- /dev/null +++ b/recipes-sota/config/files/60-polling-interval.toml @@ -0,0 +1,2 @@ +[uptane] +polling_sec = @POLLING_SEC@ -- cgit v1.2.3-54-g00ecf