Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@dataclass(kw_only=True)
class UbootConsole(Driver):
prompt: str = "=>"
prompt: str = "\n=>"

@classmethod
def client(cls) -> str:
Expand Down
Loading