diff options
author | Anton Gerasimov <anton@advancedtelematic.com> | 2017-06-07 13:09:00 +0200 |
---|---|---|
committer | Anton Gerasimov <anton@advancedtelematic.com> | 2017-06-14 15:46:04 +0200 |
commit | cdd7e90cba4d5b697a296a69df7e08341299f688 (patch) | |
tree | 92d8346b77727e56d681bbdba0e1c31fcc3a88e9 /recipes-sota | |
parent | b31ea51285bb9b7e17887c8c9006cec3122f32e6 (diff) | |
download | meta-updater-cdd7e90cba4d5b697a296a69df7e08341299f688.tar.gz |
Add uptane-capable aktualizr
Diffstat (limited to 'recipes-sota')
-rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 18 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/aktualizr-autoprovision.service | 14 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/sota_autoprov.toml | 18 | ||||
-rw-r--r-- | recipes-sota/rvi-sota-client/rvi-sota-client_git.bb | 2 |
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" | |||
5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
7 | DEPENDS = "boost curl openssl jansson libsodium ostree" | 7 | DEPENDS = "boost curl openssl jansson libsodium ostree" |
8 | SRCREV = "4e9344ae375a444f02b964dca52fe808010d17df" | ||
9 | PV = "1.0+git${SRCPV}" | ||
10 | 8 | ||
11 | SRC_URI = " \ | 9 | SRC_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 | " |
15 | SRCREV = "2e897310c611e2da46f8af888bb62c09b2a2906a" | ||
16 | PV = "1.0+git${SRCPV}" | ||
15 | 17 | ||
16 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
17 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 19 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" |
18 | 20 | ||
19 | inherit cmake systemd | 21 | inherit cmake systemd |
20 | 22 | ||
21 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON" | 23 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" |
22 | 24 | ||
23 | export SOTA_AUTOPROVISION_CREDENTIALS | 25 | export SOTA_AUTOPROVISION_CREDENTIALS |
24 | 26 | ||
25 | do_install_append() { | 27 | do_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 | ||
34 | RDEPENDS = "" | ||
35 | |||
36 | FILES_${PN} = " \ | 39 | FILES_${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] | ||
2 | Description=Aktualizr SOTA Client | ||
3 | Wants=network-online.target | ||
4 | After=network.target network-online.target | ||
5 | Requires=network-online.target | ||
6 | |||
7 | [Service] | ||
8 | RestartSec=10 | ||
9 | Restart=always | ||
10 | EnvironmentFile=/var/sota/sota_provisioning_url.env | ||
11 | ExecStart=/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] | ||
14 | WantedBy=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] | ||
2 | packages_dir = "/tmp/packages_dir" | ||
3 | certificates_directory = "/var/sota" | ||
4 | system_info = "system_info.sh" | ||
5 | |||
6 | [tls] | ||
7 | ca_file = "root.crt" | ||
8 | client_certificate = "client.pem" | ||
9 | pkey_file = "pkey.pem" | ||
10 | |||
11 | [uptane] | ||
12 | metadata_path = "/var/sota/metadata" | ||
13 | private_key_path = "ecukey.der" | ||
14 | public_key_path = "ecukey.pub" | ||
15 | |||
16 | [provision] | ||
17 | p12_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 | " |