diff options
author | brian avery <brian.avery@intel.com> | 2017-04-19 12:49:03 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-20 07:55:10 +0100 |
commit | 7f9f1bdd714fbc6b2adc62f64bf0e4fd1d98ce05 (patch) | |
tree | 3bfc6be70f7906fc659cc6160ae933afa83a3161 | |
parent | 4829f1ebd89dc91860cf72fbbdc7b6bb0d5822bc (diff) | |
download | openembedded-core-7f9f1bdd714fbc6b2adc62f64bf0e4fd1d98ce05.tar.gz openembedded-core-7f9f1bdd714fbc6b2adc62f64bf0e4fd1d98ce05.tar.bz2 openembedded-core-7f9f1bdd714fbc6b2adc62f64bf0e4fd1d98ce05.zip |
rootfs-postcommands.bbclass: save relative paths
We pass the TOPDIR to do a search/replace in export2json so that we save
relative paths in the testdata.json file rather than absolute paths.
This is to allow the images and kernels to be relocated yet still allow
testimage to work.
[YOCTO #11375]
Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index c42829dd65..498174a664 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -132,7 +132,7 @@ zap_empty_root_password () { if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd fi -} +} # # allow dropbear/openssh to accept root logins and logins from accounts with an empty password string @@ -243,7 +243,7 @@ python write_image_manifest () { os.symlink(os.path.basename(manifest_name), manifest_link) } -# Can be use to create /etc/timestamp during image construction to give a reasonably +# Can be use to create /etc/timestamp during image construction to give a reasonably # sane default time setting rootfs_update_timestamp () { date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp @@ -286,6 +286,7 @@ rootfs_sysroot_relativelinks () { sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT} } + # Generated test data json file python write_image_test_data() { from oe.data import export2json @@ -294,7 +295,8 @@ python write_image_test_data() { testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME')) bb.utils.mkdirhier(os.path.dirname(testdata)) - export2json(d, testdata) + searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") + export2json(d, testdata,searchString=searchString,replaceString="") if os.path.lexists(testdata_link): os.remove(testdata_link) |