summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2017-05-17 17:16:00 +0200
committerAnton Gerasimov <anton@advancedtelematic.com>2017-05-24 15:29:55 +0200
commit5c36fff1607aa645f5f522d42dcd28d70d070f3b (patch)
tree1423ac87b509bdd8e1ad2445f9805fa4fa3cd21c /recipes-sota
parent221a3753efeb67ea2c5e06dc7033c03385d37a00 (diff)
downloadmeta-updater-5c36fff1607aa645f5f522d42dcd28d70d070f3b.tar.gz
Add support for zipped credentials
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/rvi-sota-client/rvi-sota-client_git.bb16
1 files changed, 2 insertions, 14 deletions
diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
index 9a3dbf9..9ba11ea 100644
--- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
+++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
@@ -153,6 +153,7 @@ RDEPENDS_${PN} = " libcrypto \
153 python-json \ 153 python-json \
154 " 154 "
155 155
156export SOTA_PACKED_CREDENTIALS
156export SOTA_AUTOPROVISION_CREDENTIALS 157export SOTA_AUTOPROVISION_CREDENTIALS
157export SOTA_AUTOPROVISION_URL 158export SOTA_AUTOPROVISION_URL
158 159
@@ -171,7 +172,7 @@ do_install() {
171 172
172 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 173 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
173 install -d ${D}/${systemd_unitdir}/system 174 install -d ${D}/${systemd_unitdir}/system
174 if [ -n "$SOTA_AUTOPROVISION_CREDENTIALS" ]; then 175 if [ -n "$SOTA_AUTOPROVISION_CREDENTIALS" -o -n "$SOTA_PACKED_CREDENTIALS" ]; then
175 install -c ${S}/run/sota_client_uptane_auto.service ${D}${systemd_unitdir}/system/sota_client.service 176 install -c ${S}/run/sota_client_uptane_auto.service ${D}${systemd_unitdir}/system/sota_client.service
176 else 177 else
177 install -c ${S}/run/sota_client_ostree.service ${D}${systemd_unitdir}/system/sota_client.service 178 install -c ${S}/run/sota_client_ostree.service ${D}${systemd_unitdir}/system/sota_client.service
@@ -184,17 +185,4 @@ do_install() {
184 install -c ${S}/run/sota_certificates ${D}${sysconfdir} 185 install -c ${S}/run/sota_certificates ${D}${sysconfdir}
185 ln -fs /lib ${D}/lib64 186 ln -fs /lib ${D}/lib64
186 187
187 if [ -n "$SOTA_AUTOPROVISION_CREDENTIALS" ]; then
188 EXPDATE=`openssl pkcs12 -in $SOTA_AUTOPROVISION_CREDENTIALS -password "pass:" -nodes 2>/dev/null | openssl x509 -noout -enddate | cut -f2 -d "="`
189
190 if [ `date +%s` -ge `date -d "${EXPDATE}" +%s` ]; then
191 bberror "Certificate ${SOTA_AUTOPROVISION_CREDENTIALS} has expired on ${EXPDATE}"
192 fi
193
194 install -d ${D}/var
195 install -d ${D}/var/sota
196 install -m 0655 $SOTA_AUTOPROVISION_CREDENTIALS ${D}/var/sota/sota_provisioning_credentials.p12
197 echo "SOTA_GATEWAY_URI=$SOTA_AUTOPROVISION_URL" > ${D}/var/sota/sota_provisioning_url.env
198 fi
199
200} 188}