summaryrefslogtreecommitdiffstats
path: root/classes/image_types_ostree.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/image_types_ostree.bbclass')
-rw-r--r--classes/image_types_ostree.bbclass13
1 files changed, 5 insertions, 8 deletions
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