mirror of
https://github.com/ARM-software/devlib.git
synced 2025-03-04 09:17:51 +00:00
plaform/juno: fix ip address from uart
In recent builds, it seems doing "ip addr list eth0" returns "no such device" when running as a regular user. Doing so as root, will give the information on the device.
This commit is contained in:
parent
83e5ddfd1b
commit
b368acb755
@ -100,12 +100,14 @@ class VersatileExpressPlatform(Platform):
|
||||
baudrate=self.baudrate,
|
||||
timeout=30,
|
||||
init_dtr=0) as tty:
|
||||
tty.sendline('')
|
||||
tty.sendline('su') # this is, apprently, required to query network device
|
||||
# info by name on recent Juno builds...
|
||||
self.logger.debug('Waiting for the Android shell prompt.')
|
||||
tty.expect(target.shell_prompt)
|
||||
|
||||
self.logger.debug('Waiting for IP address...')
|
||||
wait_start_time = time.time()
|
||||
try:
|
||||
while True:
|
||||
tty.sendline('ip addr list eth0')
|
||||
time.sleep(1)
|
||||
@ -116,6 +118,8 @@ class VersatileExpressPlatform(Platform):
|
||||
pass # We have our own timeout -- see below.
|
||||
if (time.time() - wait_start_time) > self.ready_timeout:
|
||||
raise TargetError('Could not acquire IP address.')
|
||||
finally:
|
||||
tty.sendline('exit') # exit shell created by "su" call at the start
|
||||
|
||||
def _set_hard_reset_method(self, hard_reset_method):
|
||||
if hard_reset_method == 'dtr':
|
||||
|
Loading…
x
Reference in New Issue
Block a user