summaryrefslogtreecommitdiffstats
path: root/meta/classes/devshell.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/devshell.bbclass')
-rw-r--r--meta/classes/devshell.bbclass33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
new file mode 100644
index 0000000000..92edb9ef25
--- /dev/null
+++ b/meta/classes/devshell.bbclass
@@ -0,0 +1,33 @@
1inherit terminal
2
3DEVSHELL = "${SHELL}"
4
5python do_devshell () {
6 if d.getVarFlag("do_devshell", "manualfakeroot"):
7 d.prependVar("DEVSHELL", "pseudo ")
8 fakeenv = d.getVar("FAKEROOTENV", True).split()
9 for f in fakeenv:
10 k = f.split("=")
11 d.setVar(k[0], k[1])
12 d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0])
13 d.delVarFlag("do_devshell", "fakeroot")
14
15 oe_terminal(d.getVar('DEVSHELL', True), 'OpenEmbedded Developer Shell', d)
16}
17
18addtask devshell after do_patch
19
20do_devshell[dirs] = "${S}"
21do_devshell[nostamp] = "1"
22
23# devshell and fakeroot/pseudo need careful handling since only the final
24# command should run under fakeroot emulation, any X connection should
25# be done as the normal user. We therfore carefully construct the envionment
26# manually
27python () {
28 if d.getVarFlag("do_devshell", "fakeroot"):
29 # We need to signal our code that we want fakeroot however we
30 # can't manipulate the environment and variables here yet (see YOCTO #4795)
31 d.setVarFlag("do_devshell", "manualfakeroot", "1")
32 d.delVarFlag("do_devshell", "fakeroot")
33}