diff options
author | Ricardo Salveti <ricardo@opensourcefoundries.com> | 2018-04-11 14:11:30 -0300 |
---|---|---|
committer | Ricardo Salveti <ricardo@opensourcefoundries.com> | 2018-04-11 18:41:23 -0300 |
commit | 1c48a48f0a0134e53854b4b32d558eca807df766 (patch) | |
tree | 0d1b1cd298ca7954b684e62176d4b72dc76e477f | |
parent | c2d1d2a086102cab64629ac2770055d11015af2d (diff) | |
download | meta-updater-1c48a48f0a0134e53854b4b32d558eca807df766.tar.gz |
Add support for custom garage target version and url
Both values can be defined by the user, allowing a custom version id and
URL, which is specially useful for CI builds.
Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
-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" |