summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcajun-rat <phil@advancedtelematic.com>2017-11-21 12:48:18 +0100
committerGitHub <noreply@github.com>2017-11-21 12:48:18 +0100
commit678c0a500d16f9f2993c982bbbed190b22362dc9 (patch)
tree19dc15c5936dfbf50ac6a52756ada3624a56b690
parent3d5e35d7a1afc604a18587cb736a66c0cc9c3977 (diff)
parent2ca5e74b17a01f5b0697382157241c595539b44f (diff)
downloadmeta-updater-678c0a500d16f9f2993c982bbbed190b22362dc9.tar.gz
Merge pull request #186 from advancedtelematic/feat/PRO-4290/garagecheck
Check if the package and UPTANE target got to the backend
-rw-r--r--classes/image_types_ostree.bbclass17
-rw-r--r--classes/sota.bbclass2
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb2
3 files changed, 16 insertions, 5 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"
183IMAGE_CMD_garagesign () { 183IMAGE_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
233IMAGE_TYPEDEP_garagecheck = "ostreepush garagesign"
234IMAGE_DEPENDS_garagecheck = "aktualizr-native:do_populate_sysroot"
235IMAGE_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"
11SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" 11SOTA_CLIENT_PROV ??= "aktualizr-auto-prov"
12IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" 12IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
13IMAGE_CLASSES += " image_types_ostree image_types_ota" 13IMAGE_CLASSES += " image_types_ostree image_types_ota"
14IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign otaimg wic', ' ', d)}" 14IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck otaimg wic', ' ', d)}"
15 15
16PACKAGECONFIG_append_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " ssl", " ", d)}" 16PACKAGECONFIG_append_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " ssl", " ", d)}"
17PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}" 17PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}"
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 162065e..3cd8a64 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -18,7 +18,7 @@ PR = "7"
18SRC_URI = " \ 18SRC_URI = " \
19 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 19 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
20 " 20 "
21SRCREV = "f043191ae622a96cf2f4d48f9073d5cfa9f16e3f" 21SRCREV = "612da8cae6e72ce7250de2fb5333af0d7041de7b"
22BRANCH ?= "master" 22BRANCH ?= "master"
23 23
24S = "${WORKDIR}/git" 24S = "${WORKDIR}/git"