1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

gem5Connection: Fix "as_root" to actually use root

Previously as_root was ignore. This is no longer the case!
This commit is contained in:
Sascha Bischoff 2017-11-08 08:43:55 +00:00 committed by devlab
parent efbd04992d
commit 61bbece59b

View File

@ -34,7 +34,8 @@ else:
from pexpect import EOF, TIMEOUT, spawn
from devlib.exception import HostError, TargetError, TimeoutError
from devlib.utils.misc import which, strip_bash_colors, escape_single_quotes, check_output
from devlib.utils.misc import which, strip_bash_colors, check_output
from devlib.utils.misc import escape_single_quotes, escape_double_quotes
from devlib.utils.types import boolean
@ -695,6 +696,9 @@ class Gem5Connection(TelnetConnection):
gem5_logger.debug("gem5_shell command: {}".format(command))
if as_root:
command = 'echo "{}" | su'.format(escape_double_quotes(command))
# Send the actual command
self.conn.send("{}\n".format(command))