summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo@opensourcefoundries.com>2018-04-11 14:11:30 -0300
committerPhil Wise <philip.wise@here.com>2018-05-11 15:59:17 +0200
commit9ef1f5b379e7b80d91f77ae99b6c07c07987f753 (patch)
tree4ede77ae62babb93fc139586c3f2b1107e04b07c
parent28f18be41d4b01dc5208159fd569f3820264b16e (diff)
downloadmeta-updater-9ef1f5b379e7b80d91f77ae99b6c07c07987f753.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.bbclass10
-rw-r--r--classes/sota.bbclass2
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"
31GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" 31GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo"
32GARAGE_SIGN_KEYNAME ?= "garage-key" 32GARAGE_SIGN_KEYNAME ?= "garage-key"
33GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" 33GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}"
34GARAGE_TARGET_VERSION ?= ""
35GARAGE_TARGET_URL ?= "https://example.com/"
34 36
35SOTA_MACHINE ??="none" 37SOTA_MACHINE ??="none"
36SOTA_MACHINE_rpi ?= "raspberrypi" 38SOTA_MACHINE_rpi ?= "raspberrypi"