summaryrefslogtreecommitdiffstats
path: root/classes/image_types_ostree.bbclass
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo@opensourcefoundries.com>2018-03-29 15:47:26 -0300
committerRicardo Salveti <ricardo@opensourcefoundries.com>2018-03-29 15:47:26 -0300
commit82a9c20ffb045011b53f3188d04d79f440ee8b06 (patch)
tree8309cc593f59861ed4848dea09b09b3f04e18416 /classes/image_types_ostree.bbclass
parent2619e3f3312713f4077d83b2f2e5f9c7de66d12b (diff)
parentb1a114da280a05cfc2b7b099c97101bd20cc6b8f (diff)
downloadmeta-updater-82a9c20ffb045011b53f3188d04d79f440ee8b06.tar.gz
Merge remote-tracking branch 'origin/rocko' into rocko-merge
Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
Diffstat (limited to 'classes/image_types_ostree.bbclass')
-rw-r--r--classes/image_types_ostree.bbclass26
1 files changed, 20 insertions, 6 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 5893e8d..e6d6fe0 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -9,9 +9,9 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \
9 9
10export OSTREE_REPO 10export OSTREE_REPO
11export OSTREE_BRANCHNAME 11export OSTREE_BRANCHNAME
12export GARAGE_TARGET_NAME
12 13
13RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" 14RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}"
14export GARAGE_TARGET_NAME
15 15
16OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" 16OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
17 17
@@ -194,7 +194,9 @@ IMAGE_CMD_garagesign () {
194 fi 194 fi
195 195
196 rm -rf ${GARAGE_SIGN_REPO} 196 rm -rf ${GARAGE_SIGN_REPO}
197 garage-sign init --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS} 197 garage-sign init --repo tufrepo \
198 --home-dir ${GARAGE_SIGN_REPO} \
199 --credentials ${SOTA_PACKED_CREDENTIALS}
198 200
199 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) 201 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
200 202
@@ -202,11 +204,23 @@ IMAGE_CMD_garagesign () {
202 # in which case targets.json should be pulled again and the whole procedure repeated 204 # in which case targets.json should be pulled again and the whole procedure repeated
203 push_success=0 205 push_success=0
204 for push_retries in $( seq 3 ); do 206 for push_retries in $( seq 3 ); do
205 garage-sign targets pull --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} 207 garage-sign targets pull --repo tufrepo \
206 garage-sign targets add --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --name ${GARAGE_TARGET_NAME} --format OSTREE --version ${ostree_target_hash} --length 0 --url "https://example.com/" --sha256 ${ostree_target_hash} --hardwareids ${MACHINE} 208 --home-dir ${GARAGE_SIGN_REPO}
207 garage-sign targets sign --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --key-name=targets 209 garage-sign targets add --repo tufrepo \
210 --home-dir ${GARAGE_SIGN_REPO} \
211 --name ${GARAGE_TARGET_NAME} \
212 --format OSTREE \
213 --version ${ostree_target_hash} \
214 --length 0 \
215 --url "https://example.com/" \
216 --sha256 ${ostree_target_hash} \
217 --hardwareids ${MACHINE}
218 garage-sign targets sign --repo tufrepo \
219 --home-dir ${GARAGE_SIGN_REPO} \
220 --key-name=targets
208 errcode=0 221 errcode=0
209 garage-sign targets push --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} || errcode=$? 222 garage-sign targets push --repo tufrepo \
223 --home-dir ${GARAGE_SIGN_REPO} || errcode=$?
210 if [ "$errcode" -eq "0" ]; then 224 if [ "$errcode" -eq "0" ]; then
211 push_success=1 225 push_success=1
212 break 226 break