diff --git a/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/client.py b/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/client.py index 9425fb21a..953b5cf2a 100644 --- a/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/client.py +++ b/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/client.py @@ -46,7 +46,9 @@ def reboot_to_console(self, *, debug=False) -> Generator[None]: for _ in range(100): # TODO: configurable retries try: p.send(ESC) - p.expect_exact(self.prompt, timeout=0.1) + # in case of "bootmenu" there are all sort of escape sequences in the output so try to + # catch prompt without any leading newlines, hoping it's not in the menu text somewhere + p.expect_exact(self.prompt.lstrip("\n"), timeout=0.1) except pexpect.TIMEOUT: continue @@ -69,7 +71,7 @@ def run_command(self, cmd: str, timeout: int = 60, *, _internal_log=True) -> byt self.logger.info(f"Running command: {cmd}") if not hasattr(self, "p"): raise RuntimeError("Not in a reboot_to_console context") - self.p.sendline("") + self.p.sendline("#") # just sending "\n" re-executes the last command. "#" should be a harmless no-op self.p.expect_exact(self.prompt, timeout=timeout) self.p.sendline(cmd) self.p.expect_exact(self.prompt, timeout=timeout) diff --git a/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/driver.py b/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/driver.py index 8469ff510..c61277222 100644 --- a/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/driver.py +++ b/packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/driver.py @@ -5,7 +5,7 @@ @dataclass(kw_only=True) class UbootConsole(Driver): - prompt: str = "=>" + prompt: str = "\n=>" @classmethod def client(cls) -> str: