Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 5411b73

Browse files
authored
Merge pull request #631 from michalskrivanek/uboot-prompt
Uboot prompt
2 parents c7282f0 + 6b80743 commit 5411b73

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def reboot_to_console(self, *, debug=False) -> Generator[None]:
4646
for _ in range(100): # TODO: configurable retries
4747
try:
4848
p.send(ESC)
49-
p.expect_exact(self.prompt, timeout=0.1)
49+
# in case of "bootmenu" there are all sort of escape sequences in the output so try to
50+
# catch prompt without any leading newlines, hoping it's not in the menu text somewhere
51+
p.expect_exact(self.prompt.lstrip("\n"), timeout=0.1)
5052
except pexpect.TIMEOUT:
5153
continue
5254

@@ -69,7 +71,7 @@ def run_command(self, cmd: str, timeout: int = 60, *, _internal_log=True) -> byt
6971
self.logger.info(f"Running command: {cmd}")
7072
if not hasattr(self, "p"):
7173
raise RuntimeError("Not in a reboot_to_console context")
72-
self.p.sendline("")
74+
self.p.sendline("#") # just sending "\n" re-executes the last command. "#" should be a harmless no-op
7375
self.p.expect_exact(self.prompt, timeout=timeout)
7476
self.p.sendline(cmd)
7577
self.p.expect_exact(self.prompt, timeout=timeout)

packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
@dataclass(kw_only=True)
77
class UbootConsole(Driver):
8-
prompt: str = "=>"
8+
prompt: str = "\n=>"
99

1010
@classmethod
1111
def client(cls) -> str:

0 commit comments

Comments
 (0)