diff options
Diffstat (limited to 'recipes-sota/aktualizr')
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 41 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 34 | ||||
-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 |
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 @@ | |||
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 | DEPENDS = "zip-native" | ||
7 | RDEPENDS_${PN} = "aktualizr" | 8 | RDEPENDS_${PN} = "aktualizr" |
9 | PV = "1.0" | ||
10 | PR = "6" | ||
8 | 11 | ||
9 | SRC_URI = " \ | 12 | SRC_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 | " |
15 | PV = "1.0" | ||
16 | PR = "6" | ||
17 | 18 | ||
18 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 19 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" |
19 | 20 | ||
@@ -22,18 +23,40 @@ inherit systemd | |||
22 | export SOTA_PACKED_CREDENTIALS | 23 | export SOTA_PACKED_CREDENTIALS |
23 | 24 | ||
24 | do_install_append() { | 25 | do_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 | ||
36 | FILES_${PN} = " \ | 58 | FILES_${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 @@ | |||
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 | do_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 | |||
30 | FILES_${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 @@ | |||
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..b3f99cc --- /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 = "ed2c9684d3b7e605b41a3e7dda0afded1d4a084c" | ||
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..756c868 --- /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 = "/usr/lib/sota/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 | |||