Skip to content

Commit 7729b2d

Browse files
committed
driver/bareboxdriver.py: Add parameter 'boot_command'
To adapt the BareboxDriver and be consistent with the UBootDriver, the parameter 'boot_command' is added. Now you can do something like this: targets: main: drivers: BareboxDriver: boot_command: "boot net" Signed-off-by: Fabian Meuren <[email protected]>
1 parent 9f723bd commit 7729b2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

labgrid/driver/bareboxdriver.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class BareboxDriver(CommandMixin, Driver, CommandProtocol, LinuxBootProtocol):
2929
interrupt (str): optional, string to interrupt autoboot (use "\x03" for CTRL-C)
3030
bootstring (regex): optional, regex indicating that the Linux Kernel is booting
3131
password (str): optional, password to use for access to the shell
32+
boot_command (str): optional boot command to boot target
3233
login_timeout (int): optional, timeout for access to the shell
3334
"""
3435
bindings = {"console": ConsoleProtocol, }
@@ -37,6 +38,7 @@ class BareboxDriver(CommandMixin, Driver, CommandProtocol, LinuxBootProtocol):
3738
interrupt = attr.ib(default="\n", validator=attr.validators.instance_of(str))
3839
bootstring = attr.ib(default=r"Linux version \d", validator=attr.validators.instance_of(str))
3940
password = attr.ib(default="", validator=attr.validators.instance_of(str))
41+
boot_command = attr.ib(default="boot -v", validator=attr.validators.instance_of(str))
4042
login_timeout = attr.ib(default=60, validator=attr.validators.instance_of(int))
4143

4244
def __attrs_post_init__(self):
@@ -206,4 +208,4 @@ def boot(self, name: str):
206208
if name:
207209
self.console.sendline(f"boot -v {name}")
208210
else:
209-
self.console.sendline("boot -v")
211+
self.console.sendline(self.boot_command)

0 commit comments

Comments
 (0)