summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2017-12-13 15:30:03 +0100
committerAnton Gerasimov <anton@advancedtelematic.com>2017-12-20 15:56:57 +0100
commit6630a83d1292bb96a531208b7c52aa1744c54f79 (patch)
treea4ef3b323c4ab688f4bd202c2b157625a336a88d /classes
parent057fe7e802dd2bfbbe85f57bef99bbdf0f8c25a2 (diff)
downloadmeta-updater-6630a83d1292bb96a531208b7c52aa1744c54f79.tar.gz
Fixes for Spekulatius
- New garage-sign interface - Remove garage-sign recipe (now installed with aktualizr-native) - Small but critical bugfixes in aktualizr
Diffstat (limited to 'classes')
-rw-r--r--classes/image_repo_manifest.bbclass4
-rw-r--r--classes/image_types_ostree.bbclass13
-rw-r--r--classes/sota.bbclass4
3 files changed, 9 insertions, 12 deletions
diff --git a/classes/image_repo_manifest.bbclass b/classes/image_repo_manifest.bbclass
index 2012363..467fd9a 100644
--- a/classes/image_repo_manifest.bbclass
+++ b/classes/image_repo_manifest.bbclass
@@ -14,9 +14,9 @@ HOSTTOOLS_NONFATAL += " repo "
14# Write build information to target filesystem 14# Write build information to target filesystem
15buildinfo () { 15buildinfo () {
16 if [ $(which repo) ]; then 16 if [ $(which repo) ]; then
17 repo manifest --revision-as-HEAD -o ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml || echo "Android repo tool failed to run; manifest not copied" 17 repo manifest --revision-as-HEAD -o ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml || bbwarn "Android repo tool failed to run; manifest not copied"
18 else 18 else
19 echo "Android repo tool not found; manifest not copied." 19 bbwarn "Android repo tool not found; manifest not copied."
20 fi 20 fi
21} 21}
22 22
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 56a9720..05db62a 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -179,7 +179,7 @@ IMAGE_CMD_ostreepush () {
179} 179}
180 180
181IMAGE_TYPEDEP_garagesign = "ostreepush" 181IMAGE_TYPEDEP_garagesign = "ostreepush"
182IMAGE_DEPENDS_garagesign = "garage-sign-native:do_populate_sysroot" 182IMAGE_DEPENDS_garagesign = "aktualizr-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
@@ -194,11 +194,8 @@ IMAGE_CMD_garagesign () {
194 exit 1 194 exit 1
195 fi 195 fi
196 196
197 if [ ! -d "${GARAGE_SIGN_REPO}" ]; then 197 rm -rf ${GARAGE_SIGN_REPO}
198 garage-sign init --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS} 198 garage-sign init --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS}
199 fi
200
201 reposerver_args="--reposerver $( unzip -p ${SOTA_PACKED_CREDENTIALS} tufrepo.url )"
202 199
203 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) 200 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
204 201
@@ -206,11 +203,11 @@ IMAGE_CMD_garagesign () {
206 # in which case targets.json should be pulled again and the whole procedure repeated 203 # in which case targets.json should be pulled again and the whole procedure repeated
207 push_success=0 204 push_success=0
208 for push_retries in $( seq 3 ); do 205 for push_retries in $( seq 3 ); do
209 garage-sign targets pull --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} ${reposerver_args} 206 garage-sign targets pull --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO}
210 garage-sign targets add --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --name ${OSTREE_BRANCHNAME} --format OSTREE --version ${ostree_target_hash} --length 0 --url "https://example.com/" --sha256 ${ostree_target_hash} --hardwareids ${MACHINE} 207 garage-sign targets add --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --name ${OSTREE_BRANCHNAME} --format OSTREE --version ${ostree_target_hash} --length 0 --url "https://example.com/" --sha256 ${ostree_target_hash} --hardwareids ${MACHINE}
211 garage-sign targets sign --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --key-name=targets 208 garage-sign targets sign --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --key-name=targets
212 errcode=0 209 errcode=0
213 garage-sign targets push --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} ${reposerver_args} || errcode=$? 210 garage-sign targets push --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} || errcode=$?
214 if [ "$errcode" -eq "0" ]; then 211 if [ "$errcode" -eq "0" ]; then
215 push_success=1 212 push_success=1
216 break 213 break
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 0f42332..bbb9ac9 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -13,8 +13,8 @@ IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PRO
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 garagecheck 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 = " ssl"
17PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}" 17PACKAGECONFIG_remove_pn-curl = "gnutls"
18 18
19WKS_FILE_sota ?= "sdimage-sota.wks" 19WKS_FILE_sota ?= "sdimage-sota.wks"
20 20