diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2019-05-28 08:59:05 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2019-05-28 09:01:33 +0200 |
commit | 3443bf397e0fb71488f8f26dc8cc1e4c9baaa6ff (patch) | |
tree | ce781411eb54032b46923968f1bdf5f8aee2e2a4 | |
parent | 7b2bbff583943d486d06904fed0798e375502439 (diff) |
Revert "image_type_tezi.bbclass: drop some useless code"
With thud I still see "basehash value changed" errors, even though the
commit e74158b6c is available in the OE thud branch.
This reverts commit 9f84ffa4b42b4d518191116614aef269ab227f0e.
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r-- | classes/image_type_tezi.bbclass | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass index 4573f6c..4b89020 100644 --- a/classes/image_type_tezi.bbclass +++ b/classes/image_type_tezi.bbclass @@ -26,6 +26,10 @@ UBOOT_BINARY_TEZI_RAWNAND ?= "${UBOOT_BINARY}" UBOOT_ENV_TEZI_EMMC ?= "uEnv.txt" UBOOT_ENV_TEZI_RAWNAND ?= "uEnv.txt" +# For generic images this is not yet defined +TDX_VERDATE ?= "-${DATE}" +TDX_VERDATE[vardepsexclude] = "DATE" + # Append tar command to store uncompressed image size to ${T}. # If a custom rootfs type is used make sure this file is created # before compression. @@ -192,13 +196,16 @@ def rootfs_tezi_json(d, flash_type, flash_data, json_file, uenv_file): from datetime import datetime deploydir = d.getVar('DEPLOY_DIR_IMAGE') + # Patched in IMAGE_CMD_teziimg() below + release_date = "%release_date%" + data = OrderedDict({ "config_format": 2, "autoinstall": False }) # Use image recipes SUMMARY/DESCRIPTION/PV... data["name"] = d.getVar('SUMMARY') data["description"] = d.getVar('DESCRIPTION') data["version"] = d.getVar('PV') - data["release_date"] = datetime.strptime(d.getVar('DATE'), '%Y%m%d').date().isoformat() + data["release_date"] = release_date data["u_boot_env"] = uenv_file if os.path.exists(os.path.join(deploydir, "prepare.sh")): data["prepare_script"] = "prepare.sh" @@ -234,8 +241,6 @@ def rootfs_tezi_json(d, flash_type, flash_data, json_file, uenv_file): json.dump(data, outfile, indent=4) bb.note("Toradex Easy Installer metadata file {0} written.".format(json_file)) -rootfs_tezi_json[vardepsexclude] = "DATE" - python rootfs_tezi_run_json() { flash_type = d.getVar('TORADEX_FLASH_TYPE') if flash_type is None: @@ -265,7 +270,14 @@ do_image_teziimg[prefuncs] += "create_tezi_bootfs rootfs_tezi_run_json" IMAGE_CMD_teziimg () { bbnote "Create Toradex Easy Installer tarball" + # Fixup release_date in image.json, convert ${TDX_VERDATE} to isoformat + # This works around the non fatal ERRORS: "the basehash value changed" when DATE is referenced + # in a python prefunction to do_image + ISODATE=$(echo ${TDX_VERDATE} | sed 's/.\(....\)\(..\)\(..\).*/\1-\2-\3/') + sed -i "s/%release_date%/$ISODATE/" ${DEPLOY_DIR_IMAGE}/image.json + cd ${DEPLOY_DIR_IMAGE} + case "${TORADEX_FLASH_TYPE}" in rawnand) # The first transform strips all folders from the files to tar, the @@ -273,7 +285,7 @@ IMAGE_CMD_teziimg () { ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.tar \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}${TDX_VERDATE}.tar \ image.json toradexlinux.png marketing.tar prepare.sh wrapup.sh \ ${SPL_BINARY} ${UBOOT_BINARY_TEZI_RAWNAND} ${UBOOT_ENV_TEZI_RAWNAND} ${TEZI_KERNEL_IMAGETYPE} ${TEZI_KERNEL_DEVICETREE} \ ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${TEZI_ROOT_SUFFIX} @@ -284,7 +296,7 @@ IMAGE_CMD_teziimg () { ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.tar \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}${TDX_VERDATE}.tar \ image.json toradexlinux.png marketing.tar prepare.sh wrapup.sh \ ${SPL_BINARY} ${UBOOT_BINARY_TEZI_EMMC} ${UBOOT_ENV_TEZI_EMMC} ${IMGDEPLOYDIR}/${IMAGE_NAME}.bootfs.tar.xz \ ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${TEZI_ROOT_SUFFIX} @@ -383,10 +395,19 @@ IMAGE_CMD_teziimg-distro () { bbnote "Create Toradex Easy Installer tarball" cd ${DEPLOY_DIR_IMAGE} + + # Fixup release_date in image.json, convert ${DATE} to isoformat + # This works around the non fatal ERRORS: "the basehash value changed" when DATE is referenced + # in a python prefunction to do_image + ISODATE=$(echo ${DATE} | sed 's/\(....\)\(..\)\(..\)/\1-\2-\3/') + for TEZI_IMAGE_JSON in ${TEZI_IMAGE_JSON_FILES}; do + sed -i "s/%release_date%/$ISODATE/" ${DEPLOY_DIR_IMAGE}/${TEZI_IMAGE_JSON} + done + ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.tar \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}${TDX_VERDATE}.tar \ ${TEZI_IMAGE_JSON_FILES} toradexlinux.png marketing.tar prepare.sh wrapup.sh \ ${TEZI_IMAGE_UBOOT_FILES} ${IMGDEPLOYDIR}/${IMAGE_NAME}.bootfs.tar.xz \ ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${TEZI_ROOT_SUFFIX} |