Added SHELL and TERM to environment whitelist and start $SHELL if set

Currently the shell provided via the 'shell' command is always '/bin/sh'
and does not have a TERM variable set. This is a rather spartan shell
experience.

With this patch we add the TERM variable to the whitelist, so that
pagers work better and made the shell binary dependent from the SHELL
environment variable. If no such variable is set, we fall back to using
'/bin/sh'.

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine 2017-06-19 10:11:36 +02:00 committed by Daniel Wagner
parent bb2e98344a
commit 81a30bc600
2 changed files with 3 additions and 2 deletions

View File

@ -170,7 +170,8 @@ def get_oe_environ(config, build_dir):
ew = env['BB_ENV_EXTRAWHITE'] + ' '.join(vars)
env.update({'BB_ENV_EXTRAWHITE': ew})
vars.extend(['SSH_AGENT_PID', 'SSH_AUTH_SOCK'])
vars.extend(['SSH_AGENT_PID', 'SSH_AUTH_SOCK',
'SHELL', 'TERM'])
for v in vars:
if v in os.environ:

View File

@ -73,7 +73,7 @@ class ShellCommand(Command):
return 'shell'
def execute(self, config):
cmd = ['/bin/sh']
cmd = [config.environ.get('SHELL', '/bin/sh')]
if self.cmd:
cmd.append('-c')
cmd.append(self.cmd)