diff options
author | Jon Oster <tkfu@users.noreply.github.com> | 2017-05-26 18:05:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 18:05:06 +0200 |
commit | 0b12ce650252ed88de8dbc6f9daa93bc964e351d (patch) | |
tree | 531775ef05e4c2219ecf9ff1102210c5903205cd /recipes-sota | |
parent | 134caccaddd5bc038885c05c0b31fdd15b26e8e2 (diff) | |
parent | 08b5230c9503b080b566d7bfc6d8daa9b3075555 (diff) | |
download | meta-updater-0b12ce650252ed88de8dbc6f9daa93bc964e351d.tar.gz |
Merge pull request #64 from advancedtelematic/feat/PRO-2945/zipcreds
Add support for zipped credentials
Diffstat (limited to 'recipes-sota')
-rw-r--r-- | recipes-sota/rvi-sota-client/rvi-sota-client_git.bb | 16 |
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 | ||
156 | export SOTA_PACKED_CREDENTIALS | ||
156 | export SOTA_AUTOPROVISION_CREDENTIALS | 157 | export SOTA_AUTOPROVISION_CREDENTIALS |
157 | export SOTA_AUTOPROVISION_URL | 158 | export 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 | } |