summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-09-06 19:11:34 -0700
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-10-03 14:50:22 +0200
commiteb90d685df3347b0536e9b8c26011edc880ea593 (patch)
tree789a2e7a8cddb91b6bfb2066770e643c895db1ee
parent6044483b27efc81954ab68c04471a20850517238 (diff)
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 <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--classes/image_type_tezi.bbclass12
1 files 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"