aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-09-16 09:20:56 +0100
committerRobert Yang <liezhi.yang@windriver.com>2016-09-19 03:46:30 -0700
commitf492d54928ebae7cf8acb176b17ae4cbc154a14b (patch)
tree211d3bf0a818080866e21eb991325f9528ba5978
parentfe576ca6b2462a6a7a933dbb22439d43804e79a7 (diff)
downloadopenembedded-core-contrib-f492d54928ebae7cf8acb176b17ae4cbc154a14b.tar.gz
qemuboot: write the full kernel filename, not the link name
KERNEL_IMAGETYPE gives the filename of a symlink to the kernel, which may not be available i.e. if the user downloads some build artefacts to run on a local machine. It's also possible that the link will point to a newer kernel than was intended for use with the rootfs in the qemuboot.conf. It's much more reliable to read the name of the file KERNEL_IMAGETYPE is linking to and assign the full filename to QB_DEFAULT_KERNEL. [YOCTO #10285] Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
-rw-r--r--meta/classes/qemuboot.bbclass8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 8500c7343a..0892db3f3a 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -63,6 +63,14 @@ python write_qemuboot_conf() {
cf.add_section('config_bsp')
for k in build_vars + qb_vars:
cf.set('config_bsp', k, '%s' % d.getVar(k, True))
+
+ # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink
+ # to the kernel file, which hinders relocatability of the qb conf.
+ # Read the link and replace it with the full filename of the target.
+ kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('QB_DEFAULT_KERNEL', True))
+ kernel = os.readlink(kernel_link)
+ cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel)
+
with open(qemuboot, 'w') as f:
cf.write(f)