summaryrefslogtreecommitdiffstats
path: root/recipes-sota/aktualizr
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-sota/aktualizr')
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb41
-rw-r--r--recipes-sota/aktualizr/aktualizr-implicit-prov.bb34
-rw-r--r--recipes-sota/aktualizr/aktualizr-native_git.bb16
-rw-r--r--recipes-sota/aktualizr/aktualizr_common.inc19
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb29
-rw-r--r--recipes-sota/aktualizr/files/sota_implicit_prov.toml11
6 files changed, 121 insertions, 29 deletions
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index 054b5cd..48777b2 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -1,10 +1,13 @@
1SUMMARY = "Aktualizr systemd service and configurations" 1SUMMARY = "Aktualizr systemd service and configurations"
2DESCRIPTION = "Systemd service and configurations for Aktualizr, the SOTA Client application written in C++" 2DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7DEPENDS = "zip-native"
7RDEPENDS_${PN} = "aktualizr" 8RDEPENDS_${PN} = "aktualizr"
9PV = "1.0"
10PR = "6"
8 11
9SRC_URI = " \ 12SRC_URI = " \
10 file://LICENSE \ 13 file://LICENSE \
@@ -12,8 +15,6 @@ SRC_URI = " \
12 file://aktualizr-autoprovision.service \ 15 file://aktualizr-autoprovision.service \
13 file://sota_autoprov.toml \ 16 file://sota_autoprov.toml \
14 " 17 "
15PV = "1.0"
16PR = "6"
17 18
18SYSTEMD_SERVICE_${PN} = "aktualizr.service" 19SYSTEMD_SERVICE_${PN} = "aktualizr.service"
19 20
@@ -22,18 +23,40 @@ inherit systemd
22export SOTA_PACKED_CREDENTIALS 23export SOTA_PACKED_CREDENTIALS
23 24
24do_install_append() { 25do_install_append() {
26 if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then
27 bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS"
28 fi
29 if [ -n "${SOTA_AUTOPROVISION_URL}" ]; then
30 bbwarn "SOTA_AUTOPROVISION_URL is ignored. Please use SOTA_PACKED_CREDENTIALS"
31 fi
32 if [ -n "${SOTA_AUTOPROVISION_URL_FILE}" ]; then
33 bbwarn "SOTA_AUTOPROVISION_URL_FILE is ignored. Please use SOTA_PACKED_CREDENTIALS"
34 fi
35 if [ -n "${OSTREE_PUSH_CREDENTIALS}" ]; then
36 bbwarn "OSTREE_PUSH_CREDENTIALS is ignored. Please use SOTA_PACKED_CREDENTIALS"
37 fi
38
25 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 39 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
26 install -d ${D}/${systemd_unitdir}/system 40 install -d ${D}/${systemd_unitdir}/system
27 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service 41 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service
28 install -d ${D}/usr/lib/sota 42 install -d ${D}/usr/lib/sota
29 install -m "0644" ${WORKDIR}/sota_autoprov.toml ${D}/usr/lib/sota/sota.toml 43 install -m "0644" ${WORKDIR}/sota_autoprov.toml ${D}/usr/lib/sota/sota.toml
44
45 # deploy SOTA credentials
46 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
47 mkdir -p ${D}/var/sota
48 cp ${SOTA_PACKED_CREDENTIALS} ${D}/var/sota/sota_provisioning_credentials.zip
49 # Device should not be able to push data to treehub
50 zip -d ${D}/var/sota/sota_provisioning_credentials.zip treehub.json
51 fi
30 else 52 else
31 install -d ${D}/${systemd_unitdir}/system 53 install -d ${D}/${systemd_unitdir}/system
32 install -m 0644 ${WORKDIR}/aktualizr-manual-provision.service ${D}/${systemd_unitdir}/system/aktualizr.service 54 install -m 0644 ${WORKDIR}/aktualizr-manual-provision.service ${D}/${systemd_unitdir}/system/aktualizr.service
33 fi 55 fi
34} 56}
35 57
36FILES_${PN} = " \ 58FILES_${PN} = " \
37 ${systemd_unitdir}/system/aktualizr.service \ 59 ${systemd_unitdir}/system/aktualizr.service \
38 /usr/lib/sota/sota.toml \ 60 /usr/lib/sota/sota.toml \
61 /var/sota/sota_provisioning_credentials.zip \
39 " 62 "
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
new file mode 100644
index 0000000..a01ef48
--- /dev/null
+++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
@@ -0,0 +1,34 @@
1SUMMARY = "Aktualizr systemd service and configurations"
2DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base"
5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7DEPENDS = "aktualizr-native"
8RDEPENDS_${PN} = "aktualizr"
9PV = "1.0"
10PR = "1"
11
12SRC_URI = " \
13 file://LICENSE \
14 file://aktualizr-autoprovision.service \
15 file://sota_implicit_prov.toml \
16 "
17
18SYSTEMD_SERVICE_${PN} = "aktualizr.service"
19
20inherit systemd
21
22do_install() {
23 install -d ${D}/${systemd_unitdir}/system
24 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service
25 install -d ${D}/usr/lib/sota
26 aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \
27 -i ${WORKDIR}/sota_implicit_prov.toml -o ${D}/usr/lib/sota/sota.toml -p ${D}
28}
29
30FILES_${PN} = " \
31 ${systemd_unitdir}/system/aktualizr.service \
32 /usr/lib/sota/sota.toml \
33 /usr/lib/sota/root.crt \
34 "
diff --git a/recipes-sota/aktualizr/aktualizr-native_git.bb b/recipes-sota/aktualizr/aktualizr-native_git.bb
new file mode 100644
index 0000000..59479fd
--- /dev/null
+++ b/recipes-sota/aktualizr/aktualizr-native_git.bb
@@ -0,0 +1,16 @@
1require aktualizr_common.inc
2
3DEPENDS = "boost-native openssl-native libarchive-native libsodium-native"
4
5inherit native
6
7EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=OFF -DAKTUALIZR_VERSION=${PV}"
8
9do_install_append () {
10 rm ${D}${bindir}/aktualizr
11 rm ${D}${bindir}/aktualizr_cert_provider
12}
13
14FILES_${PN} = " \
15 ${bindir}/aktualizr_implicit_writer \
16 "
diff --git a/recipes-sota/aktualizr/aktualizr_common.inc b/recipes-sota/aktualizr/aktualizr_common.inc
new file mode 100644
index 0000000..b3f99cc
--- /dev/null
+++ b/recipes-sota/aktualizr/aktualizr_common.inc
@@ -0,0 +1,19 @@
1SUMMARY = "Aktualizr SOTA Client"
2DESCRIPTION = "SOTA Client application written in C++"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base"
5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7
8PV = "1.0+git${SRCPV}"
9PR = "7"
10
11SRC_URI = " \
12 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
13 "
14SRCREV = "ed2c9684d3b7e605b41a3e7dda0afded1d4a084c"
15BRANCH ?= "master"
16
17S = "${WORKDIR}/git"
18
19inherit cmake
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 2d0dadc..4f6a175 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -1,32 +1,21 @@
1SUMMARY = "Aktualizr SOTA Client" 1require aktualizr_common.inc
2DESCRIPTION = "SOTA Client application written in C++" 2
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3DEPENDS = "boost curl jansson openssl libarchive libsodium ostree"
4SECTION = "base"
5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7DEPENDS = "boost curl openssl jansson libsodium ostree"
8RDEPENDS_${PN} = "lshw" 4RDEPENDS_${PN} = "lshw"
9 5
10DEPENDS_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)}" 6DEPENDS_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)}"
11
12RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)}" 7RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)}"
13RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm-test', ' softhsm softhsm-testtoken', '', d)}" 8RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm-test', ' softhsm softhsm-testtoken', '', d)}"
14 9
15SRC_URI = " \ 10inherit systemd
16 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
17 "
18SRCREV = "1004efa3f86cef90c012b34620992b5762b741e3"
19BRANCH ?= "master"
20
21PV = "1.0+git${SRCPV}"
22PR = "7"
23
24S = "${WORKDIR}/git"
25
26inherit cmake systemd
27 11
28EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" 12EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}"
29 13
14do_install_append () {
15 rm ${D}${bindir}/aktualizr_cert_provider
16 rm ${D}${bindir}/aktualizr_implicit_writer
17}
18
30FILES_${PN} = " \ 19FILES_${PN} = " \
31 ${bindir}/aktualizr \ 20 ${bindir}/aktualizr \
32 " 21 "
diff --git a/recipes-sota/aktualizr/files/sota_implicit_prov.toml b/recipes-sota/aktualizr/files/sota_implicit_prov.toml
new file mode 100644
index 0000000..756c868
--- /dev/null
+++ b/recipes-sota/aktualizr/files/sota_implicit_prov.toml
@@ -0,0 +1,11 @@
1[tls]
2certificates_directory = "/var/sota/"
3ca_file = "/usr/lib/sota/root.crt"
4client_certificate = "client.pem"
5pkey_file = "pkey.pem"
6
7[uptane]
8metadata_path = "/var/sota/metadata"
9private_key_path = "ecukey.der"
10public_key_path = "ecukey.pub"
11