diff options
author | Anton Gerasimov <anton@advancedtelematic.com> | 2017-11-21 11:26:53 +0100 |
---|---|---|
committer | Anton Gerasimov <anton@advancedtelematic.com> | 2017-11-21 11:28:47 +0100 |
commit | 2ca5e74b17a01f5b0697382157241c595539b44f (patch) | |
tree | 19dc15c5936dfbf50ac6a52756ada3624a56b690 /classes | |
parent | 3d5e35d7a1afc604a18587cb736a66c0cc9c3977 (diff) | |
download | meta-updater-2ca5e74b17a01f5b0697382157241c595539b44f.tar.gz |
Check if the package and UPTANE target got to the backend
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 17 | ||||
-rw-r--r-- | classes/sota.bbclass | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 172f2c8..db8cae6 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -183,7 +183,7 @@ IMAGE_DEPENDS_garagesign = "garage-sign-native:do_populate_sysroot" | |||
183 | IMAGE_CMD_garagesign () { | 183 | IMAGE_CMD_garagesign () { |
184 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 184 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
185 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 185 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
186 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec 2>&1 >/dev/null || exit 0 | 186 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec repo.url 2>&1 >/dev/null || exit 0 |
187 | 187 | ||
188 | java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) | 188 | java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) |
189 | if [ "${java_version}" = "" ]; then | 189 | if [ "${java_version}" = "" ]; then |
@@ -227,9 +227,20 @@ IMAGE_CMD_garagesign () { | |||
227 | bberror "Couldn't push to garage repository" | 227 | bberror "Couldn't push to garage repository" |
228 | exit 1 | 228 | exit 1 |
229 | fi | 229 | fi |
230 | else | ||
231 | bbwarn "SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS." | ||
232 | fi | 230 | fi |
233 | } | 231 | } |
234 | 232 | ||
233 | IMAGE_TYPEDEP_garagecheck = "ostreepush garagesign" | ||
234 | IMAGE_DEPENDS_garagecheck = "aktualizr-native:do_populate_sysroot" | ||
235 | IMAGE_CMD_garagecheck () { | ||
236 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | ||
237 | # if credentials are issued by a server that doesn't support offline signing, exit silently | ||
238 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec repo.url 2>&1 >/dev/null || exit 0 | ||
239 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | ||
240 | |||
241 | garage-check --ref=${ostree_target_hash} \ | ||
242 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | ||
243 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt | ||
244 | fi | ||
245 | } | ||
235 | # vim:set ts=4 sw=4 sts=4 expandtab: | 246 | # vim:set ts=4 sw=4 sts=4 expandtab: |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index f5a42c1..0f42332 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -11,7 +11,7 @@ SOTA_CLIENT ??= "aktualizr" | |||
11 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" | 11 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" |
12 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" | 12 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" |
13 | IMAGE_CLASSES += " image_types_ostree image_types_ota" | 13 | IMAGE_CLASSES += " image_types_ostree image_types_ota" |
14 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign otaimg wic', ' ', d)}" | 14 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck otaimg wic', ' ', d)}" |
15 | 15 | ||
16 | PACKAGECONFIG_append_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " ssl", " ", d)}" | 16 | PACKAGECONFIG_append_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " ssl", " ", d)}" |
17 | PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}" | 17 | PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}" |