diff options
Diffstat (limited to 'recipes-sota')
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 35 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 2 |
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" | |||
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" |
8 | PV = "1.0" | 9 | PV = "1.0" |
9 | PR = "6" | 10 | PR = "6" |
@@ -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 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 | ||
20 | inherit systemd | 20 | inherit systemd |
21 | 21 | ||
22 | export SOTA_PACKED_CREDENTIALS | ||
23 | |||
24 | do_install() { | 22 | do_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 |