diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-10-22 14:58:56 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-10-22 14:58:56 +0900 |
commit | 4204309872da5cb401cbb2729d9e2d4869a87f42 (patch) | |
tree | c7415e8600205e40ff7e91e8e5f4c411f30329f2 /external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb | |
parent | 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (diff) |
agl-basesystem 0.1sandbox/ToshikazuOhiwa/master
Diffstat (limited to 'external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb')
-rw-r--r-- | external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb b/external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb index dbb5fde5..9c6f0dd4 100644 --- a/external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb +++ b/external/meta-updater/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb @@ -6,22 +6,32 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 inherit allarch -DEPENDS = "aktualizr-native zip-native" +DEPENDS = "zip-native" ALLOW_EMPTY_${PN} = "1" +# If the config file from aktualizr used here is changed, you will need to bump +# the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! +PV = "1.0" +PR = "1" + +SRC_URI = "" + 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 + # root.json contains the root metadata for bootstrapping the Uptane metadata verification process. + # autoprov.url has the URL to the device gateway on the server, which is where we send most of our requests. + # autoprov_credentials.p12 contains the shared provisioning credentials. + for var in root.json autoprov.url autoprov_credentials.p12; do + if unzip -l "${SOTA_PACKED_CREDENTIALS}" $var > /dev/null; then + unzip "${SOTA_PACKED_CREDENTIALS}" $var -d ${T} + zip -mj -q ${D}${localstatedir}/sota/sota_provisioning_credentials.zip ${T}/$var + else + bbwarn "$var is missing from credentials.zip" + fi + done fi } |