diff options
-rw-r--r-- | classes/image_types_ostree.bbclass | 10 | ||||
-rw-r--r-- | classes/sota.bbclass | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 46b31b5..bc27c09 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -201,6 +201,12 @@ IMAGE_CMD_garagesign () { | |||
201 | 201 | ||
202 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 202 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
203 | 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 | |||
204 | # 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 |
205 | # 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 |
206 | push_success=0 | 212 | push_success=0 |
@@ -211,9 +217,9 @@ IMAGE_CMD_garagesign () { | |||
211 | --home-dir ${GARAGE_SIGN_REPO} \ | 217 | --home-dir ${GARAGE_SIGN_REPO} \ |
212 | --name ${GARAGE_TARGET_NAME} \ | 218 | --name ${GARAGE_TARGET_NAME} \ |
213 | --format OSTREE \ | 219 | --format OSTREE \ |
214 | --version ${ostree_target_hash} \ | 220 | --version ${target_version} \ |
215 | --length 0 \ | 221 | --length 0 \ |
216 | --url "https://example.com/" \ | 222 | --url "${GARAGE_TARGET_URL}" \ |
217 | --sha256 ${ostree_target_hash} \ | 223 | --sha256 ${ostree_target_hash} \ |
218 | --hardwareids ${MACHINE} | 224 | --hardwareids ${MACHINE} |
219 | garage-sign targets sign --repo tufrepo \ | 225 | garage-sign targets sign --repo tufrepo \ |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 4e525e2..1e765f0 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -31,6 +31,8 @@ OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" | |||
31 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" | 31 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" |
32 | GARAGE_SIGN_KEYNAME ?= "garage-key" | 32 | GARAGE_SIGN_KEYNAME ?= "garage-key" |
33 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" | 33 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" |
34 | GARAGE_TARGET_VERSION ?= "" | ||
35 | GARAGE_TARGET_URL ?= "https://example.com/" | ||
34 | 36 | ||
35 | SOTA_MACHINE ??="none" | 37 | SOTA_MACHINE ??="none" |
36 | SOTA_MACHINE_rpi ?= "raspberrypi" | 38 | SOTA_MACHINE_rpi ?= "raspberrypi" |