summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-11-25 11:37:06 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:19 +0000
commit60e5310f56c6148675c42a170529a57381d6da12 (patch)
tree0c706c7a214f8aa0170a1ae42fba3fd0c7cb82e4
parent4054b25d5ec2394fe0ccba349bb90b1845ab6a5d (diff)
downloadpoky-60e5310f56c6148675c42a170529a57381d6da12.tar.gz
classes/rootfs-postcommands: Add write_image_test_data
This function will generates testdata.json by image type. [YOCTO #10231] (From OE-Core rev: 4c0061422df472395ca0caa76ef92adb860f1167) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/rootfs-postcommands.bbclass18
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 ; "
14# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled 14# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
15ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}' 15ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
16 16
17# Generates test data file with data store variables expanded in json format
18ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; "
19
17# Write manifest 20# Write manifest
18IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest" 21IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest"
19ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; " 22ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; "
@@ -300,3 +303,18 @@ rootfs_check_host_user_contaminated () {
300rootfs_sysroot_relativelinks () { 303rootfs_sysroot_relativelinks () {
301 sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT} 304 sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}
302} 305}
306
307# Generated test data json file
308python write_image_test_data() {
309 from oe.data import export2json
310
311 testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_NAME', True))
312 testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_LINK_NAME', True))
313
314 bb.utils.mkdirhier(os.path.dirname(testdata))
315 export2json(d, testdata)
316
317 if os.path.lexists(testdata_link):
318 os.remove(testdata_link)
319 os.symlink(os.path.basename(testdata), testdata_link)
320}