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-26 08:32:13 +0100 |
| commit | 3e2478a28228b50e3282a6f227f505e229d390db (patch) | |
| tree | fc8c24dd48d9f145a41a5b24b235c4c23e6d6899 | |
| parent | 121e851c84a5d8ad08681c34972615e0c4ac7382 (diff) | |
| download | poky-3e2478a28228b50e3282a6f227f505e229d390db.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: 48fe148e5ca344d2a6bad444ef48d9c5ea414448)
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>
(cherry picked from commit 23d296b3567aa31bad7b2a8558d4bd3e4505843b)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -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: |
