diff options
-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 31f8d40..0c076c8 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -167,25 +167,19 @@ IMAGE_CMD_ostreecommit () { | |||
167 | fi | 167 | fi |
168 | 168 | ||
169 | # Commit the result | 169 | # Commit the result |
170 | ostree --repo=${OSTREE_REPO} commit \ | 170 | ostree_target_hash=$(ostree --repo=${OSTREE_REPO} commit \ |
171 | --tree=dir=${OSTREE_ROOTFS} \ | 171 | --tree=dir=${OSTREE_ROOTFS} \ |
172 | --skip-if-unchanged \ | 172 | --skip-if-unchanged \ |
173 | --branch=${OSTREE_BRANCHNAME} \ | 173 | --branch=${OSTREE_BRANCHNAME} \ |
174 | --subject="${OSTREE_COMMIT_SUBJECT}" \ | 174 | --subject="${OSTREE_COMMIT_SUBJECT}" \ |
175 | --body="${OSTREE_COMMIT_BODY}" \ | 175 | --body="${OSTREE_COMMIT_BODY}" \ |
176 | --add-metadata-string=version="${OSTREE_COMMIT_VERSION}" \ | 176 | --add-metadata-string=version="${OSTREE_COMMIT_VERSION}") |
177 | --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}" | 177 | |
178 | echo $ostree_target_hash > ${WORKDIR}/ostree_manifest | ||
178 | 179 | ||
179 | if [ ${@ oe.types.boolean('${OSTREE_UPDATE_SUMMARY}')} = True ]; then | 180 | if [ ${@ oe.types.boolean('${OSTREE_UPDATE_SUMMARY}')} = True ]; then |
180 | ostree --repo=${OSTREE_REPO} summary -u | 181 | ostree --repo=${OSTREE_REPO} summary -u |
181 | fi | 182 | fi |
182 | |||
183 | # To enable simultaneous bitbaking of two images with the same branch name, | ||
184 | # create a new ref in the repo using the basename of the image. (This first | ||
185 | # requires deleting it if it already exists.) Fixes OTA-2211. | ||
186 | ostree --repo=${OSTREE_REPO} refs --delete ${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} | ||
187 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | ||
188 | ostree --repo=${OSTREE_REPO} refs --create=${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} ${ostree_target_hash} | ||
189 | } | 183 | } |
190 | 184 | ||
191 | IMAGE_TYPEDEP_ostreepush = "ostreecommit" | 185 | IMAGE_TYPEDEP_ostreepush = "ostreecommit" |
@@ -235,7 +229,7 @@ IMAGE_CMD_garagesign () { | |||
235 | --home-dir ${GARAGE_SIGN_REPO} \ | 229 | --home-dir ${GARAGE_SIGN_REPO} \ |
236 | --credentials ${SOTA_PACKED_CREDENTIALS} | 230 | --credentials ${SOTA_PACKED_CREDENTIALS} |
237 | 231 | ||
238 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 232 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
239 | 233 | ||
240 | # Use OSTree target hash as version if none was provided by the user | 234 | # Use OSTree target hash as version if none was provided by the user |
241 | target_version=${ostree_target_hash} | 235 | target_version=${ostree_target_hash} |
@@ -311,7 +305,7 @@ IMAGE_CMD_garagecheck () { | |||
311 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 305 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
312 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 | 306 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 |
313 | 307 | ||
314 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 308 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
315 | 309 | ||
316 | garage-check --ref=${ostree_target_hash} \ | 310 | garage-check --ref=${ostree_target_hash} \ |
317 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 311 | --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="" |