From a8449cde4b81fa822e3474b88c2ee9bef0067d99 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Thu, 12 Apr 2018 15:31:24 -0300 Subject: Check for custom target version for installed_versions Make sure to use the custom target version when creating installed_versions if defined by the user. Signed-off-by: Ricardo Salveti --- classes/image_types_ota.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index b14faf3..6b93d57 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -107,7 +107,11 @@ IMAGE_CMD_otaimg () { # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local # Set package version for the first deployment - echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${ostree_target_hash}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions + target_version=${ostree_target_hash} + if [ -n "${GARAGE_TARGET_VERSION}" ]; then + target_version=${GARAGE_TARGET_VERSION} + fi + echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions rm -rf ${HOME_TMP} -- cgit v1.2.3-54-g00ecf