[oe-commits] [openembedded-core] 17/29: qemuboot: write the full kernel filename, not the link name
git at git.openembedded.org
git at git.openembedded.org
Mon Sep 19 08:12:11 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit d57bdacab13605ada4cd9e9159c18fdcd6eeacbc
Author: Joshua Lock <joshua.g.lock at intel.com>
AuthorDate: Sun Sep 18 00:39:24 2016 -0700
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 at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/qemuboot.bbclass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 8500c73..0892db3 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)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list