summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/image_types_ostree.bbclass4
-rw-r--r--classes/sota.bbclass2
-rw-r--r--classes/sota_bleeding.inc1
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb6
-rw-r--r--recipes-sota/aktualizr/aktualizr-implicit-prov.bb36
-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
9 files changed, 99 insertions, 25 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index cb520c2..26be7bf 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -20,6 +20,8 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
20 20
21export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" 21export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}"
22 22
23SOTA_IMPLICIT_PROV = "${@bb.utils.contains('DISTRO_FEATURES', 'implicit-prov', 'true', '', d)}"
24
23IMAGE_CMD_ostree () { 25IMAGE_CMD_ostree () {
24 if [ -z "$OSTREE_REPO" ]; then 26 if [ -z "$OSTREE_REPO" ]; then
25 bbfatal "OSTREE_REPO should be set in your local.conf" 27 bbfatal "OSTREE_REPO should be set in your local.conf"
@@ -134,7 +136,7 @@ IMAGE_CMD_ostree () {
134 fi 136 fi
135 137
136 # deploy SOTA credentials 138 # deploy SOTA credentials
137 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 139 if [ -n "${SOTA_PACKED_CREDENTIALS}" -a -z "${SOTA_IMPLICIT_PROV}" ]; then
138 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then 140 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
139 cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip 141 cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip
140 # Device should not be able to push data to treehub 142 # Device should not be able to push data to treehub
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index d3b66e0..357fefd 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -6,7 +6,7 @@ python __anonymous() {
6OVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" 6OVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}"
7 7
8SOTA_CLIENT ??= "aktualizr" 8SOTA_CLIENT ??= "aktualizr"
9SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" 9SOTA_CLIENT_PROV ??= "${@bb.utils.contains('DISTRO_FEATURES', 'implicit-prov', 'aktualizr-implicit-prov', 'aktualizr-auto-prov', d)}"
10IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" 10IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
11IMAGE_CLASSES += " image_types_ostree image_types_ota" 11IMAGE_CLASSES += " image_types_ostree image_types_ota"
12IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush otaimg wic', ' ', d)}" 12IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush otaimg wic', ' ', d)}"
diff --git a/classes/sota_bleeding.inc b/classes/sota_bleeding.inc
index fc5947d..77d004b 100644
--- a/classes/sota_bleeding.inc
+++ b/classes/sota_bleeding.inc
@@ -1 +1,2 @@
1SRCREV_pn-aktualizr ?= "${AUTOREV}" 1SRCREV_pn-aktualizr ?= "${AUTOREV}"
2SRCREV_pn-aktualizr-native ?= "${AUTOREV}"
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index 054b5cd..b30e884 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -1,10 +1,12 @@
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"
7RDEPENDS_${PN} = "aktualizr" 7RDEPENDS_${PN} = "aktualizr"
8PV = "1.0"
9PR = "6"
8 10
9SRC_URI = " \ 11SRC_URI = " \
10 file://LICENSE \ 12 file://LICENSE \
@@ -12,8 +14,6 @@ SRC_URI = " \
12 file://aktualizr-autoprovision.service \ 14 file://aktualizr-autoprovision.service \
13 file://sota_autoprov.toml \ 15 file://sota_autoprov.toml \
14 " 16 "
15PV = "1.0"
16PR = "6"
17 17
18SYSTEMD_SERVICE_${PN} = "aktualizr.service" 18SYSTEMD_SERVICE_${PN} = "aktualizr.service"
19 19
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
new file mode 100644
index 0000000..edec409
--- /dev/null
+++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
@@ -0,0 +1,36 @@
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
22export SOTA_PACKED_CREDENTIALS
23
24do_install() {
25 install -d ${D}/${systemd_unitdir}/system
26 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service
27 install -d ${D}/usr/lib/sota
28 aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \
29 -i ${WORKDIR}/sota_implicit_prov.toml -o ${D}/usr/lib/sota/sota.toml -p ${D}
30}
31
32FILES_${PN} = " \
33 ${systemd_unitdir}/system/aktualizr.service \
34 /usr/lib/sota/sota.toml \
35 /var/sota/root.crt \
36 "
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..61854ea
--- /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 = "1004efa3f86cef90c012b34620992b5762b741e3"
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..31e2946
--- /dev/null
+++ b/recipes-sota/aktualizr/files/sota_implicit_prov.toml
@@ -0,0 +1,11 @@
1[tls]
2certificates_directory = "/var/sota/"
3ca_file = "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