diff options
-rw-r--r-- | classes/image_types_ota.bbclass | 2 | ||||
-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 | ||||
-rw-r--r-- | recipes-support/python-petname/python-petname.bb | 1 |
6 files changed, 45 insertions, 10 deletions
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 8108d51..2dd6846 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -92,7 +92,7 @@ IMAGE_CMD_otaimg () { | |||
92 | kargs_list="${kargs_list} --karg-append=$arg" | 92 | kargs_list="${kargs_list} --karg-append=$arg" |
93 | done | 93 | done |
94 | 94 | ||
95 | ostree admin --sysroot=${PHYS_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${OSTREE_OSNAME}:${OSTREE_BRANCHNAME} | 95 | ostree admin --sysroot=${PHYS_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${OSTREE_BRANCHNAME} |
96 | 96 | ||
97 | # Copy deployment /home and /var/sota to sysroot | 97 | # Copy deployment /home and /var/sota to sysroot |
98 | HOME_TMP=`mktemp -d ${WORKDIR}/home-tmp-XXXXX` | 98 | HOME_TMP=`mktemp -d ${WORKDIR}/home-tmp-XXXXX` |
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 b0d91eb..5a08670 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 | " |
diff --git a/recipes-support/python-petname/python-petname.bb b/recipes-support/python-petname/python-petname.bb index b8a7b88..9abd5d9 100644 --- a/recipes-support/python-petname/python-petname.bb +++ b/recipes-support/python-petname/python-petname.bb | |||
@@ -13,3 +13,4 @@ RDEPENDS_${PN} = " python-setuptools \ | |||
13 | python-argparse \ | 13 | python-argparse \ |
14 | " | 14 | " |
15 | 15 | ||
16 | FILES_${PN} = "${libdir} ${bindir}/petname" | ||