summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2017-06-07 13:09:00 +0200
committerAnton Gerasimov <anton@advancedtelematic.com>2017-06-14 15:46:04 +0200
commitcdd7e90cba4d5b697a296a69df7e08341299f688 (patch)
tree92d8346b77727e56d681bbdba0e1c31fcc3a88e9 /recipes-sota
parentb31ea51285bb9b7e17887c8c9006cec3122f32e6 (diff)
downloadmeta-updater-cdd7e90cba4d5b697a296a69df7e08341299f688.tar.gz
Add uptane-capable aktualizr
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb18
-rw-r--r--recipes-sota/aktualizr/files/aktualizr-autoprovision.service14
-rw-r--r--recipes-sota/aktualizr/files/sota_autoprov.toml18
-rw-r--r--recipes-sota/rvi-sota-client/rvi-sota-client_git.bb2
4 files changed, 43 insertions, 9 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index fa71af8..62ee9b0 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -5,35 +5,39 @@ SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7DEPENDS = "boost curl openssl jansson libsodium ostree" 7DEPENDS = "boost curl openssl jansson libsodium ostree"
8SRCREV = "4e9344ae375a444f02b964dca52fe808010d17df"
9PV = "1.0+git${SRCPV}"
10 8
11SRC_URI = " \ 9SRC_URI = " \
12 git://github.com/advancedtelematic/aktualizr \ 10 git://github.com/advancedtelematic/aktualizr \
13 file://aktualizr-manual-provision.service \ 11 file://aktualizr-manual-provision.service \
12 file://aktualizr-autoprovision.service \
13 file://sota_autoprov.toml \
14 " 14 "
15SRCREV = "2e897310c611e2da46f8af888bb62c09b2a2906a"
16PV = "1.0+git${SRCPV}"
15 17
16S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
17SYSTEMD_SERVICE_${PN} = "aktualizr.service" 19SYSTEMD_SERVICE_${PN} = "aktualizr.service"
18 20
19inherit cmake systemd 21inherit cmake systemd
20 22
21EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON" 23EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}"
22 24
23export SOTA_AUTOPROVISION_CREDENTIALS 25export SOTA_AUTOPROVISION_CREDENTIALS
24 26
25do_install_append() { 27do_install_append() {
26 if [ -n "$SOTA_AUTOPROVISION_CREDENTIALS" ]; then 28 if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" -o -n "${SOTA_PACKED_CREDENTIALS}" ]; then
27 bbwarn "Aktualizr recipe currently lacks support for SOTA_AUTOPROVISION_CREDENTIALS. No systemd service will be created" 29 install -d ${D}/${systemd_unitdir}/system
30 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service
31 install -d ${D}/var/sota
32 install -m "0644" ${WORKDIR}/sota_autoprov.toml ${D}/var/sota/sota.toml
28 else 33 else
29 install -d ${D}/${systemd_unitdir}/system 34 install -d ${D}/${systemd_unitdir}/system
30 install -m 0644 ${WORKDIR}/aktualizr-manual-provision.service ${D}/${systemd_unitdir}/system/aktualizr.service 35 install -m 0644 ${WORKDIR}/aktualizr-manual-provision.service ${D}/${systemd_unitdir}/system/aktualizr.service
31 fi 36 fi
32} 37}
33 38
34RDEPENDS = ""
35
36FILES_${PN} = " \ 39FILES_${PN} = " \
37 ${bindir}/aktualizr \ 40 ${bindir}/aktualizr \
38 ${systemd_unitdir}/system/aktualizr.service \ 41 ${systemd_unitdir}/system/aktualizr.service \
42 /var/sota/sota.toml \
39 " 43 "
diff --git a/recipes-sota/aktualizr/files/aktualizr-autoprovision.service b/recipes-sota/aktualizr/files/aktualizr-autoprovision.service
new file mode 100644
index 0000000..a5b92e3
--- /dev/null
+++ b/recipes-sota/aktualizr/files/aktualizr-autoprovision.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=Aktualizr SOTA Client
3Wants=network-online.target
4After=network.target network-online.target
5Requires=network-online.target
6
7[Service]
8RestartSec=10
9Restart=always
10EnvironmentFile=/var/sota/sota_provisioning_url.env
11ExecStart=/bin/sh -c "/usr/bin/aktualizr --disable-keyid-validation --tls-server ${SOTA_GATEWAY_URI} --primary-ecu-hardware-id `cat /etc/hostname` --config /var/sota/sota.toml"
12
13[Install]
14WantedBy=multi-user.target
diff --git a/recipes-sota/aktualizr/files/sota_autoprov.toml b/recipes-sota/aktualizr/files/sota_autoprov.toml
new file mode 100644
index 0000000..8799553
--- /dev/null
+++ b/recipes-sota/aktualizr/files/sota_autoprov.toml
@@ -0,0 +1,18 @@
1[device]
2packages_dir = "/tmp/packages_dir"
3certificates_directory = "/var/sota"
4system_info = "system_info.sh"
5
6[tls]
7ca_file = "root.crt"
8client_certificate = "client.pem"
9pkey_file = "pkey.pem"
10
11[uptane]
12metadata_path = "/var/sota/metadata"
13private_key_path = "ecukey.der"
14public_key_path = "ecukey.pub"
15
16[provision]
17p12_path = "sota_provisioning_credentials.p12"
18
diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
index 52edd26..87fa752 100644
--- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
+++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
@@ -30,8 +30,6 @@ FILES_${PN} = " \
30 ${bindir}/sota_prov.sh \ 30 ${bindir}/sota_prov.sh \
31 ${sysconfdir}/sota_client.version \ 31 ${sysconfdir}/sota_client.version \
32 ${sysconfdir}/sota_certificates \ 32 ${sysconfdir}/sota_certificates \
33 /var/sota/sota_provisioning_credentials.p12 \
34 /var/sota/sota_provisioning_url.env \
35 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota_client_autoprovision.service', '', d)} \ 33 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota_client_autoprovision.service', '', d)} \
36 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota_client.service', '', d)} \ 34 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota_client.service', '', d)} \
37 " 35 "