diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 18 | ||||
-rw-r--r-- | classes/image_types_ota.bbclass | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index a8a6c39..dad625d 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -168,25 +168,19 @@ IMAGE_CMD_ostreecommit () { | |||
168 | fi | 168 | fi |
169 | 169 | ||
170 | # Commit the result | 170 | # Commit the result |
171 | ostree --repo=${OSTREE_REPO} commit \ | 171 | ostree_target_hash=$(ostree --repo=${OSTREE_REPO} commit \ |
172 | --tree=dir=${OSTREE_ROOTFS} \ | 172 | --tree=dir=${OSTREE_ROOTFS} \ |
173 | --skip-if-unchanged \ | 173 | --skip-if-unchanged \ |
174 | --branch=${OSTREE_BRANCHNAME} \ | 174 | --branch=${OSTREE_BRANCHNAME} \ |
175 | --subject="${OSTREE_COMMIT_SUBJECT}" \ | 175 | --subject="${OSTREE_COMMIT_SUBJECT}" \ |
176 | --body="${OSTREE_COMMIT_BODY}" \ | 176 | --body="${OSTREE_COMMIT_BODY}" \ |
177 | --add-metadata-string=version="${OSTREE_COMMIT_VERSION}" \ | 177 | --add-metadata-string=version="${OSTREE_COMMIT_VERSION}") |
178 | --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}" | 178 | |
179 | echo $ostree_target_hash > ${WORKDIR}/ostree_manifest | ||
179 | 180 | ||
180 | if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then | 181 | if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then |
181 | ostree --repo=${OSTREE_REPO} summary -u | 182 | ostree --repo=${OSTREE_REPO} summary -u |
182 | fi | 183 | fi |
183 | |||
184 | # To enable simultaneous bitbaking of two images with the same branch name, | ||
185 | # create a new ref in the repo using the basename of the image. (This first | ||
186 | # requires deleting it if it already exists.) Fixes OTA-2211. | ||
187 | ostree --repo=${OSTREE_REPO} refs --delete ${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} | ||
188 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | ||
189 | ostree --repo=${OSTREE_REPO} refs --create=${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} ${ostree_target_hash} | ||
190 | } | 184 | } |
191 | 185 | ||
192 | IMAGE_TYPEDEP_ostreepush = "ostreecommit" | 186 | IMAGE_TYPEDEP_ostreepush = "ostreecommit" |
@@ -236,7 +230,7 @@ IMAGE_CMD_garagesign () { | |||
236 | --home-dir ${GARAGE_SIGN_REPO} \ | 230 | --home-dir ${GARAGE_SIGN_REPO} \ |
237 | --credentials ${SOTA_PACKED_CREDENTIALS} | 231 | --credentials ${SOTA_PACKED_CREDENTIALS} |
238 | 232 | ||
239 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 233 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
240 | 234 | ||
241 | # Use OSTree target hash as version if none was provided by the user | 235 | # Use OSTree target hash as version if none was provided by the user |
242 | target_version=${ostree_target_hash} | 236 | target_version=${ostree_target_hash} |
@@ -312,7 +306,7 @@ IMAGE_CMD_garagecheck () { | |||
312 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 306 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
313 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 | 307 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 |
314 | 308 | ||
315 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 309 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
316 | 310 | ||
317 | garage-check --ref=${ostree_target_hash} \ | 311 | garage-check --ref=${ostree_target_hash} \ |
318 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 312 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 374ddc2..56c7794 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -64,7 +64,7 @@ IMAGE_CMD_ota () { | |||
64 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" | 64 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" |
65 | fi | 65 | fi |
66 | 66 | ||
67 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 67 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
68 | 68 | ||
69 | ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} | 69 | ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} |
70 | kargs_list="" | 70 | kargs_list="" |