diff options
| author | Joe Slater <joe.slater@windriver.com> | 2021-08-12 15:59:31 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-13 22:43:56 +0100 |
| commit | 49ae4a23d8a9e0f8327fb009872429622761f0d1 (patch) | |
| tree | eda72eaa77602a5b8235626975875ac4d5df5c07 /meta/classes | |
| parent | 0edac1f233674f0aacc7e6653b56778aa66cfcaf (diff) | |
| download | poky-49ae4a23d8a9e0f8327fb009872429622761f0d1.tar.gz | |
terminal.bbclass: force bash for devshell
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.
(From OE-Core rev: 23d296b3567aa31bad7b2a8558d4bd3e4505843b)
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>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/terminal.bbclass | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass index 6059ae95e0..a564ee7494 100644 --- a/meta/classes/terminal.bbclass +++ b/meta/classes/terminal.bbclass | |||
| @@ -26,6 +26,9 @@ def emit_terminal_func(command, envdata, d): | |||
| 26 | bb.utils.mkdirhier(os.path.dirname(runfile)) | 26 | bb.utils.mkdirhier(os.path.dirname(runfile)) |
| 27 | 27 | ||
| 28 | with open(runfile, 'w') as script: | 28 | with open(runfile, 'w') as script: |
| 29 | # Override the shell shell_trap_code specifies. | ||
| 30 | # If our shell is bash, we might well face silent death. | ||
| 31 | script.write("#!/bin/bash\n") | ||
| 29 | script.write(bb.build.shell_trap_code()) | 32 | script.write(bb.build.shell_trap_code()) |
| 30 | bb.data.emit_func(cmd_func, script, envdata) | 33 | bb.data.emit_func(cmd_func, script, envdata) |
| 31 | script.write(cmd_func) | 34 | script.write(cmd_func) |
| @@ -37,7 +40,7 @@ def emit_terminal_func(command, envdata, d): | |||
| 37 | def oe_terminal(command, title, d): | 40 | def oe_terminal(command, title, d): |
| 38 | import oe.data | 41 | import oe.data |
| 39 | import oe.terminal | 42 | import oe.terminal |
| 40 | 43 | ||
| 41 | envdata = bb.data.init() | 44 | envdata = bb.data.init() |
| 42 | 45 | ||
| 43 | for v in os.environ: | 46 | for v in os.environ: |
