diff options
author | Joshua Lock <joshua.g.lock@intel.com> | 2016-09-18 00:39:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-20 15:11:07 +0100 |
commit | 7352d35d739acef65cfddc1923d34aa62c6f0f4c (patch) | |
tree | 54401a0f19a53c3d44c98080e93e5ceaf859df6c /meta | |
parent | 2952affc631def4bf0c239947f1b522ea42a4a02 (diff) | |
download | poky-7352d35d739acef65cfddc1923d34aa62c6f0f4c.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]
(From OE-Core rev: d57bdacab13605ada4cd9e9159c18fdcd6eeacbc)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/qemuboot.bbclass | 8 |
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() { | |||
63 | cf.add_section('config_bsp') | 63 | cf.add_section('config_bsp') |
64 | for k in build_vars + qb_vars: | 64 | for k in build_vars + qb_vars: |
65 | cf.set('config_bsp', k, '%s' % d.getVar(k, True)) | 65 | cf.set('config_bsp', k, '%s' % d.getVar(k, True)) |
66 | |||
67 | # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink | ||
68 | # to the kernel file, which hinders relocatability of the qb conf. | ||
69 | # Read the link and replace it with the full filename of the target. | ||
70 | kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('QB_DEFAULT_KERNEL', True)) | ||
71 | kernel = os.readlink(kernel_link) | ||
72 | cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel) | ||
73 | |||
66 | with open(qemuboot, 'w') as f: | 74 | with open(qemuboot, 'w') as f: |
67 | cf.write(f) | 75 | cf.write(f) |
68 | 76 | ||