From 86ec5453165c8e9b12c0c874b011d470008792a1 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 1 Jun 2018 14:42:27 +0200 Subject: aktualizr: Upgrade to use simplified implicit_writer config. There is no longer a need for dumping the whole config, now we can just add what we need to a new config file and use that in addition to the base config. This simplifies several things and fixes a few bugs. Also renamed the configs to make provenance a little clearer. --- recipes-sota/aktualizr/aktualizr-auto-prov.bb | 5 +++-- recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb | 7 ++++--- recipes-sota/aktualizr/aktualizr-hsm-prov.bb | 8 ++++++-- recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 8 ++++++-- recipes-sota/aktualizr/aktualizr_git.bb | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb index c7f1240..7f4f2e4 100644 --- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb @@ -35,7 +35,8 @@ do_install() { if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} - install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} ${D}${libdir}/sota/conf.d/20-sota.toml + install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ + ${D}${libdir}/sota/conf.d/20-${aktualizr_toml}.toml # deploy SOTA credentials if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then @@ -48,7 +49,7 @@ do_install() { FILES_${PN} = " \ ${libdir}/sota/conf.d \ - ${libdir}/sota/conf.d/20-sota.toml \ + ${libdir}/sota/conf.d/20-${aktualizr_toml}.toml \ ${localstatedir}/sota \ ${localstatedir}/sota/sota_provisioning_credentials.zip \ " diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb index c4802ed..4d5ff79 100644 --- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb @@ -52,19 +52,20 @@ do_install() { fi install -m 0700 -d ${D}${localstatedir}/sota - install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml ${D}${libdir}/sota/conf.d/20-sota.toml + install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml \ + ${D}${libdir}/sota/conf.d/20-sota_implicit_prov_ca.toml aktualizr_cert_provider --credentials ${SOTA_PACKED_CREDENTIALS} \ --device-ca ${SOTA_CACERT_PATH} \ --device-ca-key ${SOTA_CAKEY_PATH} \ --root-ca \ --server-url \ --local ${D}${localstatedir}/sota \ - --config ${D}${libdir}/sota/conf.d/20-sota.toml + --config ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml } FILES_${PN} = " \ ${libdir}/sota/conf.d \ - ${libdir}/sota/conf.d/20-sota.toml \ + ${libdir}/sota/conf.d/20-sota_implicit_prov_ca.toml \ ${libdir}/sota/root.crt \ ${localstatedir}/sota/* \ " diff --git a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb index 7e2d638..d526cd2 100644 --- a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb @@ -19,15 +19,19 @@ require credentials.inc do_install() { install -m 0700 -d ${D}${libdir}/sota/conf.d + install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml \ + ${D}${libdir}/sota/conf.d/20-sota_hsm_prov.toml if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \ - -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml -o ${D}${libdir}/sota/conf.d/20-sota.toml -p ${D} + -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml \ + -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} fi } FILES_${PN} = " \ ${libdir}/sota/conf.d \ - ${libdir}/sota/conf.d/20-sota.toml \ + ${libdir}/sota/conf.d/20-sota_hsm_prov.toml \ + ${libdir}/sota/conf.d/30-implicit_server.toml \ " # vim:set ts=4 sw=4 sts=4 expandtab: diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb index e5cd79e..e08eeef 100644 --- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb @@ -19,15 +19,19 @@ require credentials.inc do_install() { install -m 0700 -d ${D}${libdir}/sota/conf.d + install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml \ + ${D}${libdir}/sota/conf.d/20-sota_implicit_prov.toml if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \ - -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml -o ${D}${libdir}/sota/conf.d/20-sota.toml -p ${D} + -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml \ + -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} fi } FILES_${PN} = " \ ${libdir}/sota/conf.d \ - ${libdir}/sota/conf.d/20-sota.toml \ + ${libdir}/sota/conf.d/20-implicit_prov.toml \ + ${libdir}/sota/conf.d/30-implicit_server.toml \ ${libdir}/sota/root.crt \ " diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index ec7bb3c..8dc4b31 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -23,7 +23,7 @@ SRC_URI = " \ file://aktualizr-secondary.socket \ file://aktualizr-serialcan.service \ " -SRCREV = "3b89858cf8ce9a8331cc4e6a5d2b5783d2eb7ae9" +SRCREV = "114dc6c519ca9a605d73ad292821348607d0fa12" BRANCH ?= "master" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf