diff --git a/labgrid/driver/bareboxdriver.py b/labgrid/driver/bareboxdriver.py index 0aeb19d67..41f700b97 100644 --- a/labgrid/driver/bareboxdriver.py +++ b/labgrid/driver/bareboxdriver.py @@ -164,7 +164,13 @@ def _await_prompt(self): elif index == 1: # we need to interrupt autoboot - self.console.write(self.interrupt.encode('ASCII')) + interrupt = self.interrupt.encode('ASCII') + if self.interrupt.startswith('\\x'): + try: + interrupt = bytearray.fromhex(self.interrupt[2:]) + except ValueError: + pass + self.console.write(interrupt) elif index == 2: # we need to enter the password diff --git a/labgrid/driver/smallubootdriver.py b/labgrid/driver/smallubootdriver.py index 98327ab53..de4331deb 100644 --- a/labgrid/driver/smallubootdriver.py +++ b/labgrid/driver/smallubootdriver.py @@ -61,10 +61,18 @@ def _await_prompt(self): # wait for boot expression. Afterwards enter secret self.console.expect(self.boot_expression, timeout=self.login_timeout) + + secret = self.boot_secret.encode('ASCII') + if self.boot_secret.startswith('\\x'): + try: + secret = bytearray.fromhex(self.boot_secret[2:]) + except ValueError: + pass + if self.boot_secret_nolf: - self.console.write(self.boot_secret.encode('ASCII')) + self.console.write(secret) else: - self.console.sendline(self.boot_secret) + self.console.sendline(secret) self._status = 1 # wait until UBoot has reached it's prompt diff --git a/labgrid/driver/ubootdriver.py b/labgrid/driver/ubootdriver.py index cc1cd0d4b..c4c9d6501 100644 --- a/labgrid/driver/ubootdriver.py +++ b/labgrid/driver/ubootdriver.py @@ -163,7 +163,13 @@ def _await_prompt(self): break elif index == 1: - self.console.write(self.interrupt.encode('ASCII')) + interrupt = self.interrupt.encode('ASCII') + if self.interrupt.startswith('\\x'): + try: + interrupt = bytearray.fromhex(self.interrupt[2:]) + except ValueError: + pass + self.console.write(interrupt) elif index == 2: if not self.password: