mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +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:
parent
efbd04992d
commit
61bbece59b
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user