[OE-core] [PATCH] devshell: symlink $TOPDIR to $WORKDIR/topdir

Christopher Larson kergoth at gmail.com
Tue Sep 15 22:56:33 UTC 2015


From: Christopher Larson <chris_larson at mentor.com>

It's quite common to need to copy files out of the devshell back to your
layers, but most of the variables referring to such paths are not exported
(and in some cases, should not be, as it'll affect buildsystems we run, e.g.
TOPDIR/BUILDDIR). To resolve this while still making it easier to get files
out of the devshell, create a ${WORKDIR}/topdir symlink to ${TOPDIR}, removing
it after exiting the devshell.

[YOCTO #7670]

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 meta/classes/devshell.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
index 4451436..e2c200c 100644
--- a/meta/classes/devshell.bbclass
+++ b/meta/classes/devshell.bbclass
@@ -12,7 +12,10 @@ python do_devshell () {
             d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0])
        d.delVarFlag("do_devshell", "fakeroot")
 
+    topdir_link = os.path.join(d.getVar('WORKDIR', True), 'topdir')
+    os.symlink(d.getVar('TOPDIR', True), topdir_link)
     oe_terminal(d.getVar('DEVSHELL', True), 'OpenEmbedded Developer Shell', d)
+    os.unlink(topdir_link)
 }
 
 addtask devshell after do_patch
-- 
2.2.1




More information about the Openembedded-core mailing list