Skip to content

Commit

Permalink
Fix symlink for image signature
Browse files Browse the repository at this point in the history
When linking the image signature without the timestamp, the image name
suffix is omitted from the link target, leading to a broken link.

$ ls -la build/tmp/deploy/images/generic-amd64/balena-image-generic-amd64*.sig
.rw-r--r-- 512 joseph 10 Jan 10:55 build/tmp/deploy/images/generic-amd64/balena-image-generic-amd64-20250110185124.rootfs.balenaos-img.sig
lrwxrwxrwx   - joseph 10 Jan 10:55 build/tmp/deploy/images/generic-amd64/balena-image-generic-amd64.balenaos-img.sig -> balena-image-generic-amd64-20250110185124.rootfs.sig

Build the link target with the appropriate full name of the image.

Change-type: patch
Signed-off-by: Joseph Kogut <[email protected]>
  • Loading branch information
jakogut committed Jan 10, 2025
1 parent 6917dad commit 677568b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions meta-balena-common/recipes-core/images/balena-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,9 @@ generate_hostos_version () {
}

symlink_image_signature () {
# This is probably not the correct way to do it, but it works.
# We sign BALENA_RAW_IMG, which ends up in IMGDEPLOYDIR
# and has a timestamp in the file name. We need to get rid
# of the timestamp for the final deploy, so that the file
# ends up in a predictable location.

if [ -n "${SIGN_API}" ]; then
ln -sf "${BALENA_RAW_IMG}.sig" "${DEPLOY_DIR_IMAGE}/balena-image-${MACHINE}.balenaos-img.sig"
ln -sf "${IMAGE_NAME}.rootfs.balenaos-img.sig" \
"${DEPLOY_DIR_IMAGE}/balena-image-${MACHINE}.balenaos-img.sig"
fi
}

Expand Down

0 comments on commit 677568b

Please sign in to comment.