summaryrefslogtreecommitdiffstats
path: root/meta/classes/devshell.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-18 13:19:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-19 08:47:36 -0800
commit1dc9e9c3c5d841502ff4b2e42832c201e58d7ebf (patch)
treedeb8284b0d96e7ba740f33a024b50b3517d95493 /meta/classes/devshell.bbclass
parentc723d1a38f35d5922eac113b6071748199742631 (diff)
downloadpoky-1dc9e9c3c5d841502ff4b2e42832c201e58d7ebf.tar.gz
devshell.bbclass: Allow running devshell and fakeroot together
Currently its hard to run a devshell complete with fakeroot context. This patch allows the fakeroot flag on the task to do this, as with any other task. Since we may need to start X terminal applications, we need to only start the fakeroot session on the final command, hence the hoops this code jumps through. As always with fakeroot, you can break out and run a command without the fake permissions with syntax like "PSEUDO_UNLOAD=1 <command>" [YOCTO #3374] (From OE-Core rev: 0a2662a48eaf0487db043c348e2834bb9cdd0466) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/devshell.bbclass')
-rw-r--r--meta/classes/devshell.bbclass19
1 files changed, 18 insertions, 1 deletions
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
index ddb6e55303..a780118a12 100644
--- a/meta/classes/devshell.bbclass
+++ b/meta/classes/devshell.bbclass
@@ -1,10 +1,27 @@
1inherit terminal 1inherit terminal
2 2
3DEVSHELL = "${SHELL}"
4
3python do_devshell () { 5python do_devshell () {
4 oe_terminal(d.getVar('SHELL', True), 'OpenEmbedded Developer Shell', d) 6 oe_terminal(d.getVar('DEVSHELL', True), 'OpenEmbedded Developer Shell', d)
5} 7}
6 8
7addtask devshell after do_patch 9addtask devshell after do_patch
8 10
9do_devshell[dirs] = "${S}" 11do_devshell[dirs] = "${S}"
10do_devshell[nostamp] = "1" 12do_devshell[nostamp] = "1"
13
14# devshell and fakeroot/pseudo need careful handling since only the final
15# command should run under fakeroot emulation, any X connection should
16# be done as the normal user. We therfore carefully construct the envionment
17# manually
18python () {
19 if d.getVarFlag("do_devshell", "fakeroot"):
20 d.prependVar("DEVSHELL", "pseudo ")
21 fakeenv = d.getVar("FAKEROOTENV", True).split()
22 for f in fakeenv:
23 k = f.split("=")
24 d.setVar(k[0], k[1])
25 d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0])
26 d.delVarFlag("do_devshell", "fakeroot")
27}