From eb90d685df3347b0536e9b8c26011edc880ea593 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 6 Sep 2017 19:11:34 -0700 Subject: image_type_tezi: generate image.json as a image prefunc Generate the image description file just before the Tezi image gets generated by attaching rootfs_tezi_json as a prefunc of do_image. It should lead to better root file system size estimation since all do_rootfs post processing functions have been processed at that time. It also allows to move the check whether an Tezi image will be built into the anonymous python function. Later we should be able to get rid of the check by just adding rootfs_tezi_json as a prefunc of do_image_tezirun. Signed-off-by: Stefan Agner Acked-by: Marcel Ziswiler --- classes/image_type_tezi.bbclass | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass index 5422a6f..4e765e6 100644 --- a/classes/image_type_tezi.bbclass +++ b/classes/image_type_tezi.bbclass @@ -147,9 +147,6 @@ def rootfs_tezi_rawnand(d): })] python rootfs_tezi_json() { - if not bb.utils.contains("IMAGE_FSTYPES", "teziimg", True, False, d): - return - import json from collections import OrderedDict @@ -187,7 +184,14 @@ python rootfs_tezi_json() { json.dump(data, outfile, indent=4) bb.note("Toradex Easy Installer metadata file image.json written.") } -do_rootfs[postfuncs] =+ "rootfs_tezi_json" + +python () { + if bb.utils.contains("IMAGE_FSTYPES", "teziimg", True, False, d): + # do_image_teziimg does not work because the anonymous python function + # in image.bbclass gets called later and overwrites prefuncs. In master + # this is fixed, so we might be able to get rid of this work around in rocko + d.appendVarFlag('do_image', 'prefuncs', 'rootfs_tezi_json') +} IMAGE_CMD_teziimg () { bbnote "Create bootfs tarball" -- cgit v1.2.3