Skip to content
Permalink
Browse files

Make UBootDriver's autoboot string configurable

Make the hardwired string "stop autoboot" that is supposed to match the message
about stopping the autoboot configurable as a new attribute "autoboot".
This is implemented in the same way by the BareboxDriver and closes #402.

Signed-off-by: Bastian Germann <bage@linutronix.de>
  • Loading branch information...
Bastian Germann authored and jluebbe committed Mar 26, 2019
1 parent d0ee4f8 commit 133c0bd417532663afc8cbaad852137dd34cdef9
Showing with 3 additions and 1 deletion.
  1. +1 −0 doc/configuration.rst
  2. +2 −1 labgrid/driver/ubootdriver.py
@@ -750,6 +750,7 @@ Implements:
Arguments:
- prompt (regex): u-boot prompt to match
- autoboot (regex, default="stop autoboot"): autoboot message to match
- password (str): optional, u-boot unlock password
- interrupt (str, default="\\n"): string to interrupt autoboot (use "\\x03" for CTRL-C)
- init_commands (tuple): tuple of commands to execute after matching the
@@ -33,6 +33,7 @@ class UBootDriver(CommandMixin, Driver, CommandProtocol, LinuxBootProtocol):
"""
bindings = {"console": ConsoleProtocol, }
prompt = attr.ib(default="", validator=attr.validators.instance_of(str))
autoboot = attr.ib(default="stop autoboot", validator=attr.validators.instance_of(str))
password = attr.ib(default="", validator=attr.validators.instance_of(str))
interrupt = attr.ib(default="\n", validator=attr.validators.instance_of(str))
init_commands = attr.ib(default=attr.Factory(tuple), convert=tuple)
@@ -147,7 +148,7 @@ def _await_prompt(self):
"""
self.console.expect(self.boot_expression, timeout=self.login_timeout)
index, _, _, _ = self.console.expect(
[self.prompt, "stop autoboot", self.password_prompt]
[self.prompt, self.autoboot, self.password_prompt]
)
if index == 0:
self._status = 1

0 comments on commit 133c0bd

Please sign in to comment.
You can’t perform that action at this time.