summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian avery <brian.avery@intel.com>2017-04-19 12:49:04 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-20 07:55:26 +0100
commitb2b422c190af482a0b4b7291545aa3239c15a1e8 (patch)
tree885f4fabea5f8707fac46f51706fdb4f21d95952
parenta6275df081d9478d38b5ef868df9c48b23676519 (diff)
downloadpoky-b2b422c190af482a0b4b7291545aa3239c15a1e8.tar.gz
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] (From OE-Core rev: 235243d7be5df57df4767e4710b846e83f0aa9fd) Signed-off-by: brian avery <brian.avery@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/qemuboot.bbclass7
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() {
84 84
85 qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_NAME')) 85 qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_NAME'))
86 qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME')) 86 qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME'))
87 topdir="%s/"%(d.getVar('TOPDIR')).replace("//","/")
87 cf = configparser.ConfigParser() 88 cf = configparser.ConfigParser()
88 cf.add_section('config_bsp') 89 cf.add_section('config_bsp')
89 for k in qemuboot_vars(d): 90 for k in qemuboot_vars(d):
@@ -94,6 +95,9 @@ python do_write_qemuboot_conf() {
94 'qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/') 95 'qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/')
95 else: 96 else:
96 val = d.getVar(k) 97 val = d.getVar(k)
98 # we only want to write out relative paths so that we can relocate images
99 # and still run them
100 val=val.replace(topdir,"")
97 cf.set('config_bsp', k, '%s' % val) 101 cf.set('config_bsp', k, '%s' % val)
98 102
99 # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink 103 # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink
@@ -101,6 +105,9 @@ python do_write_qemuboot_conf() {
101 # Read the link and replace it with the full filename of the target. 105 # Read the link and replace it with the full filename of the target.
102 kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('QB_DEFAULT_KERNEL')) 106 kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('QB_DEFAULT_KERNEL'))
103 kernel = os.path.realpath(kernel_link) 107 kernel = os.path.realpath(kernel_link)
108 # we only want to write out relative paths so that we can relocate images
109 # and still run them
110 kernel=kernel.replace(topdir,"")
104 cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel) 111 cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel)
105 112
106 bb.utils.mkdirhier(os.path.dirname(qemuboot)) 113 bb.utils.mkdirhier(os.path.dirname(qemuboot))