diff options
Diffstat (limited to 'recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb')
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb b/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb new file mode 100644 index 0000000..dbb5fde --- /dev/null +++ b/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "Credentials for shared provisioning" | ||
2 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
3 | SECTION = "base" | ||
4 | LICENSE = "MPL-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
6 | |||
7 | inherit allarch | ||
8 | |||
9 | DEPENDS = "aktualizr-native zip-native" | ||
10 | ALLOW_EMPTY_${PN} = "1" | ||
11 | |||
12 | require credentials.inc | ||
13 | |||
14 | do_install() { | ||
15 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | ||
16 | install -m 0700 -d ${D}${localstatedir}/sota | ||
17 | cp "${SOTA_PACKED_CREDENTIALS}" ${D}${localstatedir}/sota/sota_provisioning_credentials.zip | ||
18 | # Device should not be able to push data to treehub | ||
19 | zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip treehub.json | ||
20 | # Device has no use for the API Gateway. Remove if present. See: | ||
21 | # https://github.com/advancedtelematic/ota-plus-server/pull/1913/ | ||
22 | if unzip -l ${D}${localstatedir}/sota/sota_provisioning_credentials.zip api_gateway.url > /dev/null; then | ||
23 | zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip api_gateway.url | ||
24 | fi | ||
25 | fi | ||
26 | } | ||
27 | |||
28 | FILES_${PN} = " \ | ||
29 | ${localstatedir}/sota/sota_provisioning_credentials.zip \ | ||
30 | " | ||
31 | |||
32 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||