diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2019-11-25 22:32:44 +0000 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2019-11-26 15:08:21 +0000 |
commit | e6467e51a80b60e1a11e2f3437b49cc1acf52cdb (patch) | |
tree | 34d3b9c8fcbe8a05932974d1a1eb5f2609d1f7e8 | |
parent | 325aeabea257f8750295e081bb326e34ebfc2122 (diff) |
image_type_tezi.bbclass: introduce TEZI_VERSION
Currently we use PV of the image recipe as version number for the
Toradex Easy Installer image json. When trying to implement the new
versioning scheme which introduces timestamps in PV uncovered issues
which are quite complex to overcome, see also this mailing list post:
http://lists.openembedded.org/pipermail/openembedded-core/2019-November/289765.html
To be able to implement the new versioning scheme we need to change
the source of the version number used in the Tezi image json. To be
more dynamic this introduces the variable TEZI_VERSION.
So far the class used the "Software Package Version" without the
(mandatory) date identifier. However, we used the full version with
date indentifier in the file name. This changes to use the full
"Software Package Version" in both cases by default.
Also use IMAGE_CMD_xy[vardepexclude] instead of the task name directly.
This makes sure that image.bbclass does remove the variable from the
image store and avoids premature expansion which leads in basehash
value changed issues.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r-- | classes/image_type_tezi.bbclass | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass index 45ac024..a392f28 100644 --- a/classes/image_type_tezi.bbclass +++ b/classes/image_type_tezi.bbclass @@ -16,6 +16,7 @@ DEPENDS += "${WKS_FILE_DEPENDS}" RM_WORK_EXCLUDE += "${PN}" +TEZI_VERSION ?= "${PV}-${DATE}" TEZI_ROOT_FSTYPE ??= "ext4" TEZI_ROOT_LABEL ??= "RFS" TEZI_ROOT_SUFFIX ??= "tar.xz" @@ -259,10 +260,10 @@ def rootfs_tezi_json(d, flash_type, flash_data, json_file, uenv_file): deploydir = d.getVar('DEPLOY_DIR_IMAGE') data = OrderedDict({ "config_format": 2, "autoinstall": False }) - # Use image recipes SUMMARY/DESCRIPTION/PV... + # Use image recipes SUMMARY/DESCRIPTION... data["name"] = d.getVar('SUMMARY') data["description"] = d.getVar('DESCRIPTION') - data["version"] = d.getVar('PV') + data["version"] = d.getVar('TEZI_VERSION') data["release_date"] = datetime.strptime(d.getVar('DATE', False), '%Y%m%d').date().isoformat() data["u_boot_env"] = uenv_file if os.path.exists(os.path.join(deploydir, "prepare.sh")): @@ -338,22 +339,22 @@ IMAGE_CMD_teziimg () { case "${TORADEX_FLASH_TYPE}" in rawnand) # The first transform strips all folders from the files to tar, the - # second transform "moves" them in a subfolder ${IMAGE_NAME}_${PV}. + # second transform "moves" them in a subfolder ${IMAGE_NAME}_${TEZI_VERSION}. ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ - --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.tar \ + --transform 's,^,${IMAGE_NAME}-Tezi_${TEZI_VERSION}/,' \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${TEZI_VERSION}.tar \ image.json toradexlinux.png marketing.tar prepare.sh wrapup.sh \ ${SPL_BINARY} ${UBOOT_BINARY_TEZI_RAWNAND} ${UBOOT_ENV_TEZI_RAWNAND} ${KERNEL_IMAGETYPE} ${KERNEL_DEVICETREE} \ ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${TEZI_ROOT_SUFFIX} ;; *) # The first transform strips all folders from the files to tar, the - # second transform "moves" them in a subfolder ${IMAGE_NAME}-Tezi_${PV}. + # second transform "moves" them in a subfolder ${IMAGE_NAME}-Tezi_${TEZI_VERSION}. ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ - --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.tar \ + --transform 's,^,${IMAGE_NAME}-Tezi_${TEZI_VERSION}/,' \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${TEZI_VERSION}.tar \ image.json toradexlinux.png marketing.tar prepare.sh wrapup.sh \ ${SPL_BINARY} ${UBOOT_BINARY_TEZI_EMMC} ${UBOOT_ENV_TEZI_EMMC} ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${TEZI_BOOT_SUFFIX} \ ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${TEZI_ROOT_SUFFIX} @@ -361,7 +362,7 @@ IMAGE_CMD_teziimg () { esac } do_image_teziimg[prefuncs] += "rootfs_tezi_run_json" -do_image_teziimg[vardepsexclude] = "DATE" +IMAGE_TYPEDEP_teziimg[vardepsexclude] = "TEZI_VERSION" IMAGE_TYPEDEP_teziimg += "${TEZI_BOOT_SUFFIX} ${TEZI_ROOT_SUFFIX}" @@ -404,12 +405,12 @@ IMAGE_CMD_teziimg-distro () { cd ${DEPLOY_DIR_IMAGE} ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ - --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.tar \ + --transform 's,^,${IMAGE_NAME}-Tezi_${TEZI_VERSION}/,' \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${TEZI_VERSION}.tar \ ${TEZI_IMAGE_JSON_FILES} toradexlinux.png marketing.tar prepare.sh wrapup.sh \ ${TEZI_IMAGE_UBOOT_FILES} ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${TEZI_BOOT_SUFFIX} \ ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${TEZI_ROOT_SUFFIX} } -do_image_teziimg_distro[vardepsexclude] = "DATE" +IMAGE_CMD_teziimg-distro[vardepsexclude] = "TEZI_VERSION" IMAGE_TYPEDEP_teziimg-distro += "${TEZI_BOOT_SUFFIX} ${TEZI_ROOT_SUFFIX}" |