From dbbebf1f589cdfed61fed82034a455f915f3d0b4 Mon Sep 17 00:00:00 2001 From: Xavier Gully <42768701+xaviergully@users.noreply.github.com> Date: Tue, 6 Nov 2018 14:32:27 +0100 Subject: Update README.adoc Update the reference to https://connect.ota.here.com Signed-off-by: Patrick Vacek --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index e14d7bd..46093ec 100644 --- a/README.adoc +++ b/README.adoc @@ -131,7 +131,7 @@ ostree admin deploy --os=agl agl-snapshot:agl-ota === garage-push -The https://github.com/advancedtelematic/aktualizr[aktualizr repo] contains a tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with http://www.atsgarage.com/[ATS Garage]. garage-push is used as follows: +The https://github.com/advancedtelematic/aktualizr[aktualizr repo] contains a tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with https://connect.ota.here.com/[HERE OTA Connect]. garage-push is used as follows: .... garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.zip -- cgit v1.2.3-54-g00ecf From 8ddedf6e651be33690e6e6bb54cb49c5baf6f820 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 8 Nov 2018 12:33:38 +0100 Subject: Replace more references to ATS Garage with HERE OTA Connect. Signed-off-by: Patrick Vacek --- README.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index 46093ec..d30e76b 100644 --- a/README.adoc +++ b/README.adoc @@ -6,7 +6,7 @@ This layer enables over-the-air updates (OTA) with https://github.com/ostreedev/ https://github.com/ostreedev/ostree[OSTree] is a tool for atomic full file system upgrades with rollback capability. OSTree has several advantages over traditional dual-bank systems, but the most important one is that it minimizes network bandwidth and data storage footprint by sharing files with the same contents across file system deployments. -https://github.com/advancedtelematic/aktualizr[Aktualizr] (and https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client]) add authentication and provisioning capabilities to OTA and are integrated with OSTree. You can connect with the open-source https://github.com/advancedtelematic/rvi_sota_server[RVI SOTA server] or sign up for a free account at https://app.atsgarage.com[ATS Garage] to get started. +https://github.com/advancedtelematic/aktualizr[Aktualizr] (and https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client]) add authentication and provisioning capabilities to OTA and are integrated with OSTree. You can connect with these open-source applications or sign up for a free account at https://connect.ota.here.com/[HERE OTA Connect] to get started. [discrete] == Table of Contents @@ -17,7 +17,7 @@ toc::[] === Quickstart -If you don't already have a Yocto project that you want to add OTA to, you can use the https://docs.atsgarage.com/quickstarts/raspberry-pi.html[ATS Garage Quickstart] project to rapidly get up and running on a Raspberry Pi. It takes a standard https://www.yoctoproject.org/tools-resources/projects/poky[poky] distribution, and adds OTA and OSTree capabilities. +If you don't already have a Yocto project that you want to add OTA to, you can use the https://docs.atsgarage.com/quickstarts/raspberry-pi.html[HERE OTA Connect Quickstart] project to rapidly get up and running on a Raspberry Pi. It takes a standard https://www.yoctoproject.org/tools-resources/projects/poky[poky] distribution, and adds OTA and OSTree capabilities. === Adding meta-updater capabilities to your build @@ -148,7 +148,7 @@ First, you can set `SOTA_CLIENT_PROV` to control which provisioning recipe is us Second, you can write recipes to install additional config files with customized options. A few recipes already exist to address common needs and provide an example: * link:recipes-sota/config/aktualizr-example-interface.bb[aktualizr-example-interface.bb] will configure aktualizr to connect to an example interface for a legacy flasher. This is intended to be used in conjunction with the `aktualizr-examples` package. See https://github.com/advancedtelematic/aktualizr/blob/master/docs/legacysecondary.adoc[legacysecondary.adoc] in the aktualizr repo for more information. -* link:recipes-sota/config/aktualizr-disable-send-ip.bb[aktualizr-disable-send-ip.bb] disables the reporting of networking information to the server. This is enabled by default and supported by https://app.atsgarage.com[ATS Garage]. However, if you are using a different server that does not support this feature, you may want to disable it in aktualizr. +* link:recipes-sota/config/aktualizr-disable-send-ip.bb[aktualizr-disable-send-ip.bb] disables the reporting of networking information to the server. This is enabled by default and supported by https://connect.ota.here.com/[HERE OTA Connect]. However, if you are using a different server that does not support this feature, you may want to disable it in aktualizr. * link:recipes-sota/config/aktualizr-log-debug.bb[aktualizr-log-debug.bb] sets the log level of aktualizr to 0 (trace). The default is 2 (info). This recipe is intended for development and debugging purposes. To use these recipes, you will need to add them to your image with a line such as `IMAGE_INSTALL_append = " aktualizr-log-debug "` in your `local.conf`. -- cgit v1.2.3-54-g00ecf From ecefbd8769fb32d0fbc448ce164f0d3576b2696f Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 9 Nov 2018 12:38:01 +0100 Subject: aktualizr: bump to latest for server URL newline fix. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 50a9f16..2b6ad38 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -27,7 +27,7 @@ SRC_URI = " \ file://aktualizr-serialcan.service \ " -SRCREV = "3c1c77c005fc1f872f1e12080528ed6f8a32bbf3" +SRCREV = "4621a15779db38531fb386478232a9e8593e53f4" BRANCH ?= "master" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf From feb3f35132340e141300d522bb80a8d69c695b19 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Mon, 12 Nov 2018 14:49:37 +0100 Subject: aktualizr: Fix virtual secondary support. Use /etc/sota/ecus as using /var/sota/ecus was conflicting with the provisioning recipes that also use /var/sota. Not totally ideal, but the best compromise I could find. Signed-off-by: Patrick Vacek --- README.adoc | 3 +-- classes/image_types_ostree.bbclass | 5 ----- recipes-sota/aktualizr/aktualizr-auto-prov.bb | 3 --- recipes-sota/aktualizr/aktualizr_git.bb | 7 +++++++ recipes-sota/aktualizr/environment.inc | 11 ++++------- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.adoc b/README.adoc index d30e76b..6424a28 100644 --- a/README.adoc +++ b/README.adoc @@ -86,8 +86,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w * `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. * `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-ca-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe. * `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client). -* `SOTA_SECONDARY_ECUS` - a list of paths separated by spaces of JSON configuration files for virtual secondaries on the host. These will be installed into `/var/sota/ecus` on the device. -* `SOTA_VIRTUAL_SECONDARIES` - a list of paths separated by spaces of JSON configuration files for virtual secondaries installed on the device. If `SOTA_SECONDARY_ECUS` is used to install them, then you can expect them to be installed in `/var/sota/ecus`. +* `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. == Usage diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 0db8e50..5286efc 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -126,11 +126,6 @@ IMAGE_CMD_ostree () { ln -sf var/roothome root fi - if [ -n "${SOTA_SECONDARY_ECUS}" ]; then - mkdir -p var/sota/ecus - cp ${SOTA_SECONDARY_ECUS} var/sota/ecus - fi - checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb index 01f21fa..39a5e6e 100644 --- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb @@ -30,7 +30,6 @@ do_install() { fi install -m 0700 -d ${D}${libdir}/sota/conf.d - install -m 0700 -d ${D}${localstatedir}/sota aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ @@ -40,8 +39,6 @@ do_install() { FILES_${PN} = " \ ${libdir}/sota/conf.d \ ${libdir}/sota/conf.d/20-${aktualizr_toml} \ - ${localstatedir}/sota \ - ${localstatedir}/sota/sota_provisioning_credentials.zip \ " # vim:set ts=4 sw=4 sts=4 expandtab: diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 2b6ad38..39767d4 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -69,6 +69,12 @@ do_install_append () { install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service install -m 0700 -d ${D}${libdir}/sota/conf.d install -m 0700 -d ${D}${sysconfdir}/sota/conf.d + + if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ] && [ -e "${SOTA_SECONDARY_CONFIG_DIR}" ]; then + install -m 0700 -d ${D}${sysconfdir}/sota/ecus + install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/ + fi + } do_install_append_class-target () { @@ -91,6 +97,7 @@ FILES_${PN} = " \ ${systemd_unitdir}/system/aktualizr.service \ ${libdir}/sota/conf.d \ ${sysconfdir}/sota/conf.d \ + ${sysconfdir}/sota/ecus/* \ " FILES_${PN}-examples = " \ diff --git a/recipes-sota/aktualizr/environment.inc b/recipes-sota/aktualizr/environment.inc index 16e789e..0b46a2e 100644 --- a/recipes-sota/aktualizr/environment.inc +++ b/recipes-sota/aktualizr/environment.inc @@ -1,11 +1,8 @@ -export SOTA_VIRTUAL_SECONDARIES - do_install_append() { - for sec in ${SOTA_VIRTUAL_SECONDARIES}; do - AKTUALIZR_PARAMETERS_VIRTUALSECS="${AKTUALIZR_PARAMETERS_VIRTUALSECS} --secondary-config $sec" - done - - echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_PARAMETERS_VIRTUALSECS}" > ${D}${libdir}/sota/sota.env + if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then + AKTUALIZR_CMDLINE_PARAMETERS="${AKTUALIZR_CMDLINE_PARAMETERS} --secondary-configs-dir /etc/sota/ecus" + fi + echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_CMDLINE_PARAMETERS}" > ${D}${libdir}/sota/sota.env } FILES_${PN}_append = " ${libdir}/sota/sota.env" -- cgit v1.2.3-54-g00ecf From ac1392b885595498afcaae9a3705875f1fc691ba Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 13 Nov 2018 11:38:22 +0100 Subject: aktualizr: improve secondary config directory logic. Use -d and warn if directory is invalid. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr_git.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 39767d4..61ec786 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -70,9 +70,13 @@ do_install_append () { install -m 0700 -d ${D}${libdir}/sota/conf.d install -m 0700 -d ${D}${sysconfdir}/sota/conf.d - if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ] && [ -e "${SOTA_SECONDARY_CONFIG_DIR}" ]; then - install -m 0700 -d ${D}${sysconfdir}/sota/ecus - install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/ + if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then + if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then + install -m 0700 -d ${D}${sysconfdir}/sota/ecus + install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/ + else + bbwarn "SOTA_SECONDARY_CONFIG_DIR is set to an invalid directory (${SOTA_SECONDARY_CONFIG_DIR})" + fi fi } -- cgit v1.2.3-54-g00ecf From 820e5bc3f668305584ff8c8a23c3af80652c73b4 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 13 Nov 2018 12:18:41 +0100 Subject: aktualizr: use config instead of environment variables. This should make the secondary config dir process better anyway, and it finally gets rid of a hacky workaround that we'd been using for ages. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr-auto-prov.bb | 1 - recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb | 1 - recipes-sota/aktualizr/aktualizr-hsm-prov.bb | 1 - recipes-sota/aktualizr/aktualizr_git.bb | 1 + recipes-sota/aktualizr/environment.inc | 8 -------- recipes-sota/aktualizr/files/aktualizr-secondary.service | 1 - recipes-sota/aktualizr/files/aktualizr.service | 2 -- 7 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 recipes-sota/aktualizr/environment.inc diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb index 39a5e6e..f506cab 100644 --- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb @@ -12,7 +12,6 @@ PR = "6" SRC_URI = "" -require environment.inc require credentials.inc do_install() { diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb index 2763185..5893ed2 100644 --- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb @@ -15,7 +15,6 @@ RDEPENDS_${PN}_append = "${@' aktualizr-ca-implicit-prov-creds' if d.getVar('SOT PV = "1.0" PR = "1" -require environment.inc require credentials.inc do_install() { diff --git a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb index e915046..7947edd 100644 --- a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb @@ -12,7 +12,6 @@ SRC_URI = "" PV = "1.0" PR = "6" -require environment.inc require credentials.inc do_install() { diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 61ec786..14de9fa 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -74,6 +74,7 @@ do_install_append () { if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then install -m 0700 -d ${D}${sysconfdir}/sota/ecus install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/ + echo "[uptane]\nsecondary_configs_dir = /etc/sota/ecus/\n" > ${D}${libdir}/sota/conf.d/30-secondary-configs-dir.toml else bbwarn "SOTA_SECONDARY_CONFIG_DIR is set to an invalid directory (${SOTA_SECONDARY_CONFIG_DIR})" fi diff --git a/recipes-sota/aktualizr/environment.inc b/recipes-sota/aktualizr/environment.inc deleted file mode 100644 index 0b46a2e..0000000 --- a/recipes-sota/aktualizr/environment.inc +++ /dev/null @@ -1,8 +0,0 @@ -do_install_append() { - if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then - AKTUALIZR_CMDLINE_PARAMETERS="${AKTUALIZR_CMDLINE_PARAMETERS} --secondary-configs-dir /etc/sota/ecus" - fi - echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_CMDLINE_PARAMETERS}" > ${D}${libdir}/sota/sota.env -} - -FILES_${PN}_append = " ${libdir}/sota/sota.env" diff --git a/recipes-sota/aktualizr/files/aktualizr-secondary.service b/recipes-sota/aktualizr/files/aktualizr-secondary.service index a1e0e1b..9628ee3 100644 --- a/recipes-sota/aktualizr/files/aktualizr-secondary.service +++ b/recipes-sota/aktualizr/files/aktualizr-secondary.service @@ -4,6 +4,5 @@ Description=Aktualizr SOTA Client (UPTANE Secondary) [Service] RestartSec=10 Restart=always -EnvironmentFile=-/etc/sota/sota.env ExecStart=/usr/bin/aktualizr-secondary --config /usr/lib/sota/sota_secondary.toml diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service index 6de4474..726809e 100644 --- a/recipes-sota/aktualizr/files/aktualizr.service +++ b/recipes-sota/aktualizr/files/aktualizr.service @@ -5,8 +5,6 @@ After=network.target [Service] RestartSec=10 Restart=always -EnvironmentFile=/usr/lib/sota/sota.env -EnvironmentFile=-/etc/sota/sota.env ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS [Install] -- cgit v1.2.3-54-g00ecf