summaryrefslogtreecommitdiffstats
path: root/external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb
blob: dbb5fde5bba70812170c64f688cd5f7f7a933676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
SUMMARY = "Credentials for shared provisioning"
HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
SECTION = "base"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"

inherit allarch

DEPENDS = "aktualizr-native zip-native"
ALLOW_EMPTY_${PN} = "1"

require credentials.inc

do_install() {
    if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
        install -m 0700 -d ${D}${localstatedir}/sota
        cp "${SOTA_PACKED_CREDENTIALS}" ${D}${localstatedir}/sota/sota_provisioning_credentials.zip
        # Device should not be able to push data to treehub
        zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip treehub.json
        # Device has no use for the API Gateway. Remove if present. See:
        # https://github.com/advancedtelematic/ota-plus-server/pull/1913/
        if unzip -l ${D}${localstatedir}/sota/sota_provisioning_credentials.zip api_gateway.url > /dev/null; then
            zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip api_gateway.url 
        fi
    fi
}

FILES_${PN} = " \
                ${localstatedir}/sota/sota_provisioning_credentials.zip \
                "

# vim:set ts=4 sw=4 sts=4 expandtab: