diff options
-rw-r--r-- | classes/image_types_ostree.bbclass | 12 | ||||
-rw-r--r-- | classes/image_types_ota.bbclass | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 97290ac..f3b1b33 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -159,6 +159,13 @@ IMAGE_CMD_ostree () { | |||
159 | ostree --repo=${OSTREE_REPO} summary -u | 159 | ostree --repo=${OSTREE_REPO} summary -u |
160 | fi | 160 | fi |
161 | 161 | ||
162 | # To enable simultaneous bitbaking of two images with the same branch name, | ||
163 | # create a new ref in the repo using the basename of the image. (This first | ||
164 | # requires deleting it if it already exists.) Fixes OTA-2211. | ||
165 | ostree --repo=${OSTREE_REPO} refs --delete ${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} | ||
166 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | ||
167 | ostree --repo=${OSTREE_REPO} refs --create=${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} ${ostree_target_hash} | ||
168 | |||
162 | rm -rf ${OSTREE_ROOTFS} | 169 | rm -rf ${OSTREE_ROOTFS} |
163 | } | 170 | } |
164 | 171 | ||
@@ -202,7 +209,7 @@ IMAGE_CMD_garagesign () { | |||
202 | --home-dir ${GARAGE_SIGN_REPO} \ | 209 | --home-dir ${GARAGE_SIGN_REPO} \ |
203 | --credentials ${SOTA_PACKED_CREDENTIALS} | 210 | --credentials ${SOTA_PACKED_CREDENTIALS} |
204 | 211 | ||
205 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 212 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) |
206 | 213 | ||
207 | # Use OSTree target hash as version if none was provided by the user | 214 | # Use OSTree target hash as version if none was provided by the user |
208 | target_version=${ostree_target_hash} | 215 | target_version=${ostree_target_hash} |
@@ -255,7 +262,8 @@ IMAGE_CMD_garagecheck () { | |||
255 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 262 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
256 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 263 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
257 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 | 264 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 |
258 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 265 | |
266 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | ||
259 | 267 | ||
260 | garage-check --ref=${ostree_target_hash} \ | 268 | garage-check --ref=${ostree_target_hash} \ |
261 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 269 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 56ba726..b14d2bb 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -77,7 +77,7 @@ IMAGE_CMD_otaimg () { | |||
77 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" | 77 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" |
78 | fi | 78 | fi |
79 | 79 | ||
80 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 80 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) |
81 | 81 | ||
82 | ostree --repo=${PHYS_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} | 82 | ostree --repo=${PHYS_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} |
83 | kargs_list="" | 83 | kargs_list="" |