diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2016-11-25 11:37:06 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:03:53 +0000 |
commit | 4c0061422df472395ca0caa76ef92adb860f1167 (patch) | |
tree | ebd3174cebc38a3b6da0e7738e97cf6a8b999db9 /meta | |
parent | 57c7bf68ed66a56601e1431bb2db750c5742b5ce (diff) | |
download | openembedded-core-4c0061422df472395ca0caa76ef92adb860f1167.tar.gz openembedded-core-4c0061422df472395ca0caa76ef92adb860f1167.tar.bz2 openembedded-core-4c0061422df472395ca0caa76ef92adb860f1167.zip |
classes/rootfs-postcommands: Add write_image_test_data
This function will generates testdata.json by image type.
[YOCTO #10231]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 53a4fda4b1..c8f18c6702 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -14,6 +14,9 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; " # Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}' +# Generates test data file with data store variables expanded in json format +ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; " + # Write manifest IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest" ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; " @@ -300,3 +303,18 @@ rootfs_check_host_user_contaminated () { rootfs_sysroot_relativelinks () { sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT} } + +# Generated test data json file +python write_image_test_data() { + from oe.data import export2json + + testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_NAME', True)) + testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_LINK_NAME', True)) + + bb.utils.mkdirhier(os.path.dirname(testdata)) + export2json(d, testdata) + + if os.path.lexists(testdata_link): + os.remove(testdata_link) + os.symlink(os.path.basename(testdata), testdata_link) +} |