summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2019-05-12 22:07:56 +0200
committerMing Liu <liu.ming50@gmail.com>2019-05-12 22:09:53 +0200
commit1b5ef0c9c3d5765622d45725d9fd64154cf27fed (patch)
tree5128f69a20abaa845fb02c0f47834a9c3ca2c14e
parente9cc1d5996eee20018979f4e54e2239393bd3142 (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>
-rw-r--r--classes/image_type_tezi.bbclass33
1 files changed, 6 insertions, 27 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass
index b5ddc50..f8ce33e 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.
@@ -182,16 +178,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"
@@ -227,6 +220,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:
@@ -256,14 +251,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
@@ -271,7 +259,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
@@ -282,7 +270,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
@@ -381,19 +369,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}