diff options
author | brian avery <brian.avery@intel.com> | 2017-04-19 12:49:04 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-20 07:55:20 +0100 |
commit | 235243d7be5df57df4767e4710b846e83f0aa9fd (patch) | |
tree | 20fc662ff15d97d04d5c93ddd5075653a6dc1bcc /meta/classes/qemuboot.bbclass | |
parent | 7f9f1bdd714fbc6b2adc62f64bf0e4fd1d98ce05 (diff) | |
download | openembedded-core-235243d7be5df57df4767e4710b846e83f0aa9fd.tar.gz openembedded-core-235243d7be5df57df4767e4710b846e83f0aa9fd.tar.bz2 openembedded-core-235243d7be5df57df4767e4710b846e83f0aa9fd.zip |
qemuboot.bbclass: save relative paths in conf file
This saves relative paths in the qemuboot.conf file instead of absolute
paths. This is to allow the images and kernels to be relocated and still
have the testimage and runqemu work.
[YOCTO #11375]
Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/qemuboot.bbclass')
-rw-r--r-- | meta/classes/qemuboot.bbclass | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index cc5314e4ae..86b306037f 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -84,6 +84,7 @@ python do_write_qemuboot_conf() { qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_NAME')) qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME')) + topdir="%s/"%(d.getVar('TOPDIR')).replace("//","/") cf = configparser.ConfigParser() cf.add_section('config_bsp') for k in qemuboot_vars(d): @@ -94,6 +95,9 @@ python do_write_qemuboot_conf() { 'qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/') else: val = d.getVar(k) + # we only want to write out relative paths so that we can relocate images + # and still run them + val=val.replace(topdir,"") cf.set('config_bsp', k, '%s' % val) # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink @@ -101,6 +105,9 @@ python do_write_qemuboot_conf() { # Read the link and replace it with the full filename of the target. kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('QB_DEFAULT_KERNEL')) kernel = os.path.realpath(kernel_link) + # we only want to write out relative paths so that we can relocate images + # and still run them + kernel=kernel.replace(topdir,"") cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel) bb.utils.mkdirhier(os.path.dirname(qemuboot)) |