]> code.ossystems Code Review - openembedded-core.git/commitdiff
terminal.bbclass: force bash for devshell
authorJoe Slater <joe.slater@windriver.com>
Thu, 12 Aug 2021 22:59:31 +0000 (15:59 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Aug 2021 21:43:50 +0000 (22:43 +0100)
Since shell_trap_code in build.py sets /bin/sh as the interpreter
we will die a silent death if our environment contains things like
"export -f bodilyfunction" and /bin/sh is really /bin/dash.

Fixes this for the case of devshell.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/terminal.bbclass

index 6059ae95e0d87b76c258689ed2bcff314a144518..a564ee7494722744f1abae9b93a1ca73678ea689 100644 (file)
@@ -26,6 +26,9 @@ def emit_terminal_func(command, envdata, d):
     bb.utils.mkdirhier(os.path.dirname(runfile))
 
     with open(runfile, 'w') as script:
+        # Override the shell shell_trap_code specifies.
+        # If our shell is bash, we might well face silent death.
+        script.write("#!/bin/bash\n")
         script.write(bb.build.shell_trap_code())
         bb.data.emit_func(cmd_func, script, envdata)
         script.write(cmd_func)
@@ -37,7 +40,7 @@ def emit_terminal_func(command, envdata, d):
 def oe_terminal(command, title, d):
     import oe.data
     import oe.terminal
-
+    
     envdata = bb.data.init()
 
     for v in os.environ: