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 660483e..bc44e33 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -200,6 +200,12 @@ IMAGE_CMD_garagesign () { | |||
| 200 | 200 | ||
| 201 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 201 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
| 202 | 202 | ||
| 203 | # Use OSTree target hash as version if none was provided by the user | ||
| 204 | target_version=${ostree_target_hash} | ||
| 205 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then | ||
| 206 | target_version=${GARAGE_TARGET_VERSION} | ||
| 207 | fi | ||
| 208 | |||
| 203 | # Push may fail due to race condition when multiple build machines try to push simultaneously | 209 | # Push may fail due to race condition when multiple build machines try to push simultaneously |
| 204 | # in which case targets.json should be pulled again and the whole procedure repeated | 210 | # in which case targets.json should be pulled again and the whole procedure repeated |
| 205 | push_success=0 | 211 | push_success=0 |
| @@ -210,9 +216,9 @@ IMAGE_CMD_garagesign () { | |||
| 210 | --home-dir ${GARAGE_SIGN_REPO} \ | 216 | --home-dir ${GARAGE_SIGN_REPO} \ |
| 211 | --name ${GARAGE_TARGET_NAME} \ | 217 | --name ${GARAGE_TARGET_NAME} \ |
| 212 | --format OSTREE \ | 218 | --format OSTREE \ |
| 213 | --version ${ostree_target_hash} \ | 219 | --version ${target_version} \ |
| 214 | --length 0 \ | 220 | --length 0 \ |
| 215 | --url "https://example.com/" \ | 221 | --url "${GARAGE_TARGET_URL}" \ |
| 216 | --sha256 ${ostree_target_hash} \ | 222 | --sha256 ${ostree_target_hash} \ |
| 217 | --hardwareids ${MACHINE} | 223 | --hardwareids ${MACHINE} |
| 218 | garage-sign targets sign --repo tufrepo \ | 224 | garage-sign targets sign --repo tufrepo \ |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 33a2f4b..621db24 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
| @@ -33,6 +33,8 @@ OSTREE_BOOTLOADER ??= 'u-boot' | |||
| 33 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" | 33 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" |
| 34 | GARAGE_SIGN_KEYNAME ?= "garage-key" | 34 | GARAGE_SIGN_KEYNAME ?= "garage-key" |
| 35 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" | 35 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" |
| 36 | GARAGE_TARGET_VERSION ?= "" | ||
| 37 | GARAGE_TARGET_URL ?= "https://example.com/" | ||
| 36 | 38 | ||
| 37 | SOTA_MACHINE ??="none" | 39 | SOTA_MACHINE ??="none" |
| 38 | SOTA_MACHINE_rpi ?= "raspberrypi" | 40 | SOTA_MACHINE_rpi ?= "raspberrypi" |
