diff options
-rw-r--r-- | classes/image_types_ostree.bbclass | 4 | ||||
-rw-r--r-- | classes/sota.bbclass | 2 | ||||
-rw-r--r-- | classes/sota_bleeding.inc | 1 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 6 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 36 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-native_git.bb | 16 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr_common.inc | 19 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 29 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/sota_implicit_prov.toml | 11 |
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 | ||
21 | export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" | 21 | export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" |
22 | 22 | ||
23 | SOTA_IMPLICIT_PROV = "${@bb.utils.contains('DISTRO_FEATURES', 'implicit-prov', 'true', '', d)}" | ||
24 | |||
23 | IMAGE_CMD_ostree () { | 25 | IMAGE_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() { | |||
6 | OVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" | 6 | OVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" |
7 | 7 | ||
8 | SOTA_CLIENT ??= "aktualizr" | 8 | SOTA_CLIENT ??= "aktualizr" |
9 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" | 9 | SOTA_CLIENT_PROV ??= "${@bb.utils.contains('DISTRO_FEATURES', 'implicit-prov', 'aktualizr-implicit-prov', 'aktualizr-auto-prov', d)}" |
10 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" | 10 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" |
11 | IMAGE_CLASSES += " image_types_ostree image_types_ota" | 11 | IMAGE_CLASSES += " image_types_ostree image_types_ota" |
12 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush otaimg wic', ' ', d)}" | 12 | IMAGE_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 @@ | |||
1 | SRCREV_pn-aktualizr ?= "${AUTOREV}" | 1 | SRCREV_pn-aktualizr ?= "${AUTOREV}" |
2 | SRCREV_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 @@ | |||
1 | SUMMARY = "Aktualizr systemd service and configurations" | 1 | SUMMARY = "Aktualizr systemd service and configurations" |
2 | DESCRIPTION = "Systemd service and configurations for Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++" |
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
4 | SECTION = "base" | 4 | SECTION = "base" |
5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
7 | RDEPENDS_${PN} = "aktualizr" | 7 | RDEPENDS_${PN} = "aktualizr" |
8 | PV = "1.0" | ||
9 | PR = "6" | ||
8 | 10 | ||
9 | SRC_URI = " \ | 11 | SRC_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 | " |
15 | PV = "1.0" | ||
16 | PR = "6" | ||
17 | 17 | ||
18 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 18 | SYSTEMD_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 @@ | |||
1 | SUMMARY = "Aktualizr systemd service and configurations" | ||
2 | DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++" | ||
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
4 | SECTION = "base" | ||
5 | LICENSE = "MPL-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | ||
7 | DEPENDS = "aktualizr-native" | ||
8 | RDEPENDS_${PN} = "aktualizr" | ||
9 | PV = "1.0" | ||
10 | PR = "1" | ||
11 | |||
12 | SRC_URI = " \ | ||
13 | file://LICENSE \ | ||
14 | file://aktualizr-autoprovision.service \ | ||
15 | file://sota_implicit_prov.toml \ | ||
16 | " | ||
17 | |||
18 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | ||
19 | |||
20 | inherit systemd | ||
21 | |||
22 | export SOTA_PACKED_CREDENTIALS | ||
23 | |||
24 | do_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 | |||
32 | FILES_${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 @@ | |||
1 | require aktualizr_common.inc | ||
2 | |||
3 | DEPENDS = "boost-native openssl-native libarchive-native libsodium-native" | ||
4 | |||
5 | inherit native | ||
6 | |||
7 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=OFF -DAKTUALIZR_VERSION=${PV}" | ||
8 | |||
9 | do_install_append () { | ||
10 | rm ${D}${bindir}/aktualizr | ||
11 | rm ${D}${bindir}/aktualizr_cert_provider | ||
12 | } | ||
13 | |||
14 | FILES_${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 @@ | |||
1 | SUMMARY = "Aktualizr SOTA Client" | ||
2 | DESCRIPTION = "SOTA Client application written in C++" | ||
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
4 | SECTION = "base" | ||
5 | LICENSE = "MPL-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | ||
7 | |||
8 | PV = "1.0+git${SRCPV}" | ||
9 | PR = "7" | ||
10 | |||
11 | SRC_URI = " \ | ||
12 | git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ | ||
13 | " | ||
14 | SRCREV = "1004efa3f86cef90c012b34620992b5762b741e3" | ||
15 | BRANCH ?= "master" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | inherit 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 @@ | |||
1 | SUMMARY = "Aktualizr SOTA Client" | 1 | require aktualizr_common.inc |
2 | DESCRIPTION = "SOTA Client application written in C++" | 2 | |
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | DEPENDS = "boost curl jansson openssl libarchive libsodium ostree" |
4 | SECTION = "base" | ||
5 | LICENSE = "MPL-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | ||
7 | DEPENDS = "boost curl openssl jansson libsodium ostree" | ||
8 | RDEPENDS_${PN} = "lshw" | 4 | RDEPENDS_${PN} = "lshw" |
9 | 5 | ||
10 | DEPENDS_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)}" | 6 | DEPENDS_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)}" |
11 | |||
12 | RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)}" | 7 | RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)}" |
13 | RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm-test', ' softhsm softhsm-testtoken', '', d)}" | 8 | RDEPENDS_${PN}_append = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm-test', ' softhsm softhsm-testtoken', '', d)}" |
14 | 9 | ||
15 | SRC_URI = " \ | 10 | inherit systemd |
16 | git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ | ||
17 | " | ||
18 | SRCREV = "1004efa3f86cef90c012b34620992b5762b741e3" | ||
19 | BRANCH ?= "master" | ||
20 | |||
21 | PV = "1.0+git${SRCPV}" | ||
22 | PR = "7" | ||
23 | |||
24 | S = "${WORKDIR}/git" | ||
25 | |||
26 | inherit cmake systemd | ||
27 | 11 | ||
28 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" | 12 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" |
29 | 13 | ||
14 | do_install_append () { | ||
15 | rm ${D}${bindir}/aktualizr_cert_provider | ||
16 | rm ${D}${bindir}/aktualizr_implicit_writer | ||
17 | } | ||
18 | |||
30 | FILES_${PN} = " \ | 19 | FILES_${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] | ||
2 | certificates_directory = "/var/sota/" | ||
3 | ca_file = "root.crt" | ||
4 | client_certificate = "client.pem" | ||
5 | pkey_file = "pkey.pem" | ||
6 | |||
7 | [uptane] | ||
8 | metadata_path = "/var/sota/metadata" | ||
9 | private_key_path = "ecukey.der" | ||
10 | public_key_path = "ecukey.pub" | ||
11 | |||