diff options
Diffstat (limited to 'classes/image_types_ostree.bbclass')
-rw-r--r-- | classes/image_types_ostree.bbclass | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index dc14e4a..9e3bc6f 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -1,7 +1,5 @@ | |||
1 | # OSTree deployment | 1 | # OSTree deployment |
2 | 2 | ||
3 | inherit image | ||
4 | |||
5 | do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ | 3 | do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ |
6 | openssl-native:do_populate_sysroot \ | 4 | openssl-native:do_populate_sysroot \ |
7 | coreutils-native:do_populate_sysroot \ | 5 | coreutils-native:do_populate_sysroot \ |
@@ -203,6 +201,12 @@ IMAGE_CMD_garagesign () { | |||
203 | 201 | ||
204 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 202 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
205 | 203 | ||
204 | # Use OSTree target hash as version if none was provided by the user | ||
205 | target_version=${ostree_target_hash} | ||
206 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then | ||
207 | target_version=${GARAGE_TARGET_VERSION} | ||
208 | fi | ||
209 | |||
206 | # Push may fail due to race condition when multiple build machines try to push simultaneously | 210 | # Push may fail due to race condition when multiple build machines try to push simultaneously |
207 | # in which case targets.json should be pulled again and the whole procedure repeated | 211 | # in which case targets.json should be pulled again and the whole procedure repeated |
208 | push_success=0 | 212 | push_success=0 |
@@ -213,9 +217,9 @@ IMAGE_CMD_garagesign () { | |||
213 | --home-dir ${GARAGE_SIGN_REPO} \ | 217 | --home-dir ${GARAGE_SIGN_REPO} \ |
214 | --name ${GARAGE_TARGET_NAME} \ | 218 | --name ${GARAGE_TARGET_NAME} \ |
215 | --format OSTREE \ | 219 | --format OSTREE \ |
216 | --version ${ostree_target_hash} \ | 220 | --version ${target_version} \ |
217 | --length 0 \ | 221 | --length 0 \ |
218 | --url "https://example.com/" \ | 222 | --url "${GARAGE_TARGET_URL}" \ |
219 | --sha256 ${ostree_target_hash} \ | 223 | --sha256 ${ostree_target_hash} \ |
220 | --hardwareids ${MACHINE} | 224 | --hardwareids ${MACHINE} |
221 | garage-sign targets sign --repo tufrepo \ | 225 | garage-sign targets sign --repo tufrepo \ |
@@ -231,6 +235,7 @@ IMAGE_CMD_garagesign () { | |||
231 | bbwarn "Push to garage repository has failed, retrying" | 235 | bbwarn "Push to garage repository has failed, retrying" |
232 | fi | 236 | fi |
233 | done | 237 | done |
238 | rm -rf ${GARAGE_SIGN_REPO} | ||
234 | 239 | ||
235 | if [ "$push_success" -ne "1" ]; then | 240 | if [ "$push_success" -ne "1" ]; then |
236 | bberror "Couldn't push to garage repository" | 241 | bberror "Couldn't push to garage repository" |