summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb35
-rw-r--r--recipes-sota/aktualizr/aktualizr-implicit-prov.bb2
2 files changed, 29 insertions, 8 deletions
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index b30e884..48777b2 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -4,6 +4,7 @@ HOMEPAGE = "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"
8PV = "1.0" 9PV = "1.0"
9PR = "6" 10PR = "6"
@@ -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
index 792d5ba..a01ef48 100644
--- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
@@ -19,8 +19,6 @@ SYSTEMD_SERVICE_${PN} = "aktualizr.service"
19 19
20inherit systemd 20inherit systemd
21 21
22export SOTA_PACKED_CREDENTIALS
23
24do_install() { 22do_install() {
25 install -d ${D}/${systemd_unitdir}/system 23 install -d ${D}/${systemd_unitdir}/system
26 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service 24 install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service