[OE-core] [PATCH] terminal.bbclass: use SHELL to interpret the init script
Li Zhou
li.zhou at windriver.com
Tue Jan 9 09:43:54 UTC 2018
/bin/sh was used to interpret the init script of the new terminal, below
issue occurs when SHELL="/bin/bash" and /bin/sh is linked to /bin/dash:
function foobar { echo foobar; };
export -f foobar
bitbake -c devshell virtual/kernel
Then the devshell fails to be started because "export -f xxx" is wrong
for dash.
So start the new terminal using SHELL to interpret the init srcipt,
which can solve the issue caused by the difference between SHELL and
/bin/sh.
Signed-off-by: Li Zhou <li.zhou at windriver.com>
---
meta/classes/terminal.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index a27e10c..c8e1b2f 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -25,7 +25,7 @@ def emit_terminal_func(command, envdata, d):
bb.utils.mkdirhier(os.path.dirname(runfile))
with open(runfile, 'w') as script:
- script.write('#!/bin/sh -e\n')
+ script.write('#!%s -e\n' % (d.getVar('SHELL')))
bb.data.emit_func(cmd_func, script, envdata)
script.write(cmd_func)
script.write("\n")
--
1.9.1
More information about the Openembedded-core
mailing list