diff options
author | Ming Liu <liu.ming50@gmail.com> | 2019-05-12 22:07:56 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2019-05-20 18:09:08 +0200 |
commit | 9f84ffa4b42b4d518191116614aef269ab227f0e (patch) | |
tree | be8e6ad7e3f4b3a668a595aa1053975f369dca52 | |
parent | 9f0638de3dbd274d099c583a05d4d8bfaab7d84c (diff) |
image_type_tezi.bbclass: drop some useless code
We currently have some tricky code intended to get rid of the
"basehash value changed" errors, but they are actually not needed.
Since the references to "DATE" only exist in image tasks or their
prefuncs, so they would be expanded at task executing time but not
recipe parsing time, a 'vardepsexclude' flag would be enough in this
case.
I guess the reason we introduced this piece of code was that we
found we still could see the annoying "basehash value changed" errors
with 'vardepsexclude' flag set at that moment, but that's probably was
not caused by our code, it's actually another issue now had been fixed
in OE by e74158b6cc1d683ab14ef5d47ec531f986fc2259:
[ rm_work: sort the value of do_build dependencies ]
We can safely drop these useless code per my test.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
(cherry picked from commit 1b5ef0c9c3d5765622d45725d9fd64154cf27fed)
-rw-r--r-- | classes/image_type_tezi.bbclass | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass index 6653b5a..c6f67e0 100644 --- a/classes/image_type_tezi.bbclass +++ b/classes/image_type_tezi.bbclass @@ -26,10 +26,6 @@ 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. @@ -186,16 +182,13 @@ 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"] = release_date + data["release_date"] = datetime.strptime(d.getVar('DATE'), '%Y%m%d').date().isoformat() data["u_boot_env"] = uenv_file if os.path.exists(os.path.join(deploydir, "prepare.sh")): data["prepare_script"] = "prepare.sh" @@ -231,6 +224,8 @@ 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: @@ -260,14 +255,7 @@ 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 @@ -275,7 +263,7 @@ IMAGE_CMD_teziimg () { ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}${TDX_VERDATE}.tar \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.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}.tar.xz @@ -286,7 +274,7 @@ IMAGE_CMD_teziimg () { ${IMAGE_CMD_TAR} \ --transform='s/.*\///' \ --transform 's,^,${IMAGE_NAME}-Tezi_${PV}/,' \ - -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}${TDX_VERDATE}.tar \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.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}.tar.xz @@ -385,19 +373,10 @@ 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}${TDX_VERDATE}.tar \ + -chf ${IMGDEPLOYDIR}/${IMAGE_NAME}-Tezi_${PV}-${DATE}.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} |