U-Boot driver¶
The U-Boot driver is a driver for interacting with the U-Boot bootloader. This driver does not interact with the DUT directly, instead it should be configured with backing power and serial drivers.
Driver configuration¶
type: "jumpstarter_driver_uboot.driver.UbootConsole"
children:
power:
type: "jumpstarter_driver_power.driver.MockPower"
config: {} # omitted, power driver configuration
serial:
type: "jumpstarter_driver_pyserial.driver.PySerial"
config: # omitted, serial driver configuration
url: "loop://"
# instead of configuring the power and serial driver inline
# other drivers configured on the exporter can also be referenced
# power:
# ref: "dutlink.power"
# serial:
# ref: "dutlink.console"
config:
prompt: "=>" # the u-boot command prompt to expect, defaults to "=>"
Client API¶
- class jumpstarter_driver_uboot.client.UbootConsoleClient¶
- get_env(key: str, timeout: int = 5) str | None ¶
Get U-Boot environment variable value
- property prompt: str¶
U-Boot prompt to expect
- reboot_to_console(*, debug=False) None ¶
Reboot to U-Boot console
Power cycle the target and wait for the U-Boot prompt
Must be used as a context manager, other methods can only be used within the reboot_to_console context
>>> with uboot.reboot_to_console(debug=True): ... uboot.set_env("foo", "bar") ... uboot.setup_dhcp() >>> # uboot.set_env("foo", "baz") # invalid use
- run_command(cmd: str, timeout: int = 60, *, _internal_log=True) bytes ¶
Run raw command in the U-Boot console
- run_command_checked(cmd: str, timeout: int = 60, check=True) list[str] ¶
Run command in the U-Boot console and check the exit code
- set_env(key: str, value: str | None, timeout: int = 5) None ¶
Set U-Boot environment variable value
- set_env_dict(env: dict[str, str | None]) None ¶
Set multiple U-Boot environment variable value
- setup_dhcp(timeout: int = 60) DhcpInfo ¶
Setup dhcp in U-Boot