U-Boot Environment

validate_boot_args Validate boot arguments.
UbootEnv Represents a U-Boot Environment.
UbootEnv.get_boot_order Gets the boot order specified in the uboot environment.
UbootEnv.get_contents Returns a raw string representation of the uboot environment.
UbootEnv.set_boot_order Sets the boot order specified in the uboot environment.
validate_boot_args(boot_args)[source]

Validate boot arguments. Raises a ValueError if the args are invalid.

class UbootEnv(contents=None)[source]

Represents a U-Boot Environment.

>>> from cxmanage_api.ubootenv import UbootEnv
>>> uboot = UbootEnv()
Parameters:contents (string) – UBootEnvironment contnents.
get_boot_order()[source]

Gets the boot order specified in the uboot environment.

>>> uboot.get_boot_order()
['disk', 'pxe']
Returns:Boot order for this U-Boot Environment.
Return type:string
Raises UnknownBootCmdError:
 If a boot command is unrecognized.
get_contents()[source]

Returns a raw string representation of the uboot environment.

>>> uboot.get_contents()
'j4ˆ·bootcmd_default=run bootcmd_sata; run bootcmd_pxe ... '
>>> #
>>> # Output trimmed for brevity ...
>>> #
Returns:Raw string representation of the UBoot Environment.
Return type:string
set_boot_order(boot_args)[source]

Sets the boot order specified in the uboot environment.

>>> uboot.set_boot_order(boot_args=['disk', 'pxe'])

Note

  • Valid Args:

    pxe - boot from pxe server

    disk - boot from default sata device

    diskX - boot from sata device X

    diskX:Y - boot from sata device X, partition Y

    retry - retry last boot device indefinitely

    reset - reset A9

Parameters:

boot_args (list) – Boot args (boot order). A list of strings.

Raises:
  • ValueError – If an invalid boot device is specified.
  • ValueError – If ‘retry’ and ‘reset’ args are used together.
  • Exception – If the u-boot environment is unrecognized

Previous topic

SIMG

Next topic

Ip_Retriever